/*
 * Selling Partner API for Orders
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * OpenAPI spec version: v0
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package software.amazon.spapi.api.orders.v0;

import com.amazon.SellingPartnerAPIAA.LWAAccessTokenCache;
import com.amazon.SellingPartnerAPIAA.LWAAccessTokenCacheImpl;
import com.amazon.SellingPartnerAPIAA.LWAAuthorizationCredentials;
import com.amazon.SellingPartnerAPIAA.LWAAuthorizationSigner;
import com.amazon.SellingPartnerAPIAA.LWAException;
import com.amazon.SellingPartnerAPIAA.RestrictedDataTokenSigner;
import com.google.gson.reflect.TypeToken;
import io.github.bucket4j.Bucket;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import software.amazon.spapi.ApiCallback;
import software.amazon.spapi.ApiClient;
import software.amazon.spapi.ApiException;
import software.amazon.spapi.ApiResponse;
import software.amazon.spapi.Configuration;
import software.amazon.spapi.Pair;
import software.amazon.spapi.ProgressRequestBody;
import software.amazon.spapi.StringUtil;
import software.amazon.spapi.models.orders.v0.ConfirmShipmentRequest;
import software.amazon.spapi.models.orders.v0.GetOrderAddressResponse;
import software.amazon.spapi.models.orders.v0.GetOrderBuyerInfoResponse;
import software.amazon.spapi.models.orders.v0.GetOrderItemsBuyerInfoResponse;
import software.amazon.spapi.models.orders.v0.GetOrderItemsResponse;
import software.amazon.spapi.models.orders.v0.GetOrderRegulatedInfoResponse;
import software.amazon.spapi.models.orders.v0.GetOrderResponse;
import software.amazon.spapi.models.orders.v0.GetOrdersResponse;
import software.amazon.spapi.models.orders.v0.UpdateVerificationStatusRequest;

public class OrdersV0Api {
    private ApiClient apiClient;
    private Boolean disableRateLimiting;

    public OrdersV0Api(ApiClient apiClient, Boolean disableRateLimiting) {
        this.apiClient = apiClient;
        this.disableRateLimiting = disableRateLimiting;
    }

    private final Configuration config = Configuration.get();

    public final Bucket confirmShipmentBucket = Bucket.builder()
            .addLimit(config.getLimit("OrdersV0Api-confirmShipment"))
            .build();

    public final Bucket getOrderBucket =
            Bucket.builder().addLimit(config.getLimit("OrdersV0Api-getOrder")).build();

    public final Bucket getOrderAddressBucket = Bucket.builder()
            .addLimit(config.getLimit("OrdersV0Api-getOrderAddress"))
            .build();

    public final Bucket getOrderBuyerInfoBucket = Bucket.builder()
            .addLimit(config.getLimit("OrdersV0Api-getOrderBuyerInfo"))
            .build();

    public final Bucket getOrderItemsBucket = Bucket.builder()
            .addLimit(config.getLimit("OrdersV0Api-getOrderItems"))
            .build();

    public final Bucket getOrderItemsBuyerInfoBucket = Bucket.builder()
            .addLimit(config.getLimit("OrdersV0Api-getOrderItemsBuyerInfo"))
            .build();

    public final Bucket getOrderRegulatedInfoBucket = Bucket.builder()
            .addLimit(config.getLimit("OrdersV0Api-getOrderRegulatedInfo"))
            .build();

    public final Bucket getOrdersBucket =
            Bucket.builder().addLimit(config.getLimit("OrdersV0Api-getOrders")).build();

    public final Bucket updateVerificationStatusBucket = Bucket.builder()
            .addLimit(config.getLimit("OrdersV0Api-updateVerificationStatus"))
            .build();

    /**
     * Build call for confirmShipment
     *
     * @param body Request body of &#x60;confirmShipment&#x60;. (required)
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call confirmShipmentCall(
            ConfirmShipmentRequest body,
            String orderId,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/orders/v0/orders/{orderId}/shipmentConfirmation"
                .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {"application/json"};
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "POST",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call confirmShipmentValidateBeforeCall(
            ConfirmShipmentRequest body,
            String orderId,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling confirmShipment(Async)");
        }
        // verify the required parameter 'orderId' is set
        if (orderId == null) {
            throw new ApiException("Missing the required parameter 'orderId' when calling confirmShipment(Async)");
        }

        return confirmShipmentCall(body, orderId, progressRequestListener);
    }

    /**
     * Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) |
     * Burst | | ---- | ---- | | 2 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan
     * rate limits for the operation, when available. The preceding table contains the default rate and burst values for
     * this operation. Selling partners whose business demands require higher throughput might have higher rate and
     * burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body Request body of &#x60;confirmShipment&#x60;. (required)
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public void confirmShipment(ConfirmShipmentRequest body, String orderId, String restrictedDataToken)
            throws ApiException, LWAException {
        confirmShipmentWithHttpInfo(body, orderId, restrictedDataToken);
    }

    /**
     * Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) |
     * Burst | | ---- | ---- | | 2 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan
     * rate limits for the operation, when available. The preceding table contains the default rate and burst values for
     * this operation. Selling partners whose business demands require higher throughput might have higher rate and
     * burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body Request body of &#x60;confirmShipment&#x60;. (required)
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public void confirmShipment(ConfirmShipmentRequest body, String orderId) throws ApiException, LWAException {
        confirmShipmentWithHttpInfo(body, orderId, null);
    }

    /**
     * Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) |
     * Burst | | ---- | ---- | | 2 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan
     * rate limits for the operation, when available. The preceding table contains the default rate and burst values for
     * this operation. Selling partners whose business demands require higher throughput might have higher rate and
     * burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body Request body of &#x60;confirmShipment&#x60;. (required)
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<Void> confirmShipmentWithHttpInfo(
            ConfirmShipmentRequest body, String orderId, String restrictedDataToken) throws ApiException, LWAException {
        okhttp3.Call call = confirmShipmentValidateBeforeCall(body, orderId, null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-confirmShipment");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || confirmShipmentBucket.tryConsume(1)) {
            return apiClient.execute(call);
        } else throw new ApiException.RateLimitExceeded("confirmShipment operation exceeds rate limit");
    }

    /**
     * Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests per second) |
     * Burst | | ---- | ---- | | 2 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan
     * rate limits for the operation, when available. The preceding table contains the default rate and burst values for
     * this operation. Selling partners whose business demands require higher throughput might have higher rate and
     * burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body Request body of &#x60;confirmShipment&#x60;. (required)
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<Void> confirmShipmentWithHttpInfo(ConfirmShipmentRequest body, String orderId)
            throws ApiException, LWAException {
        return confirmShipmentWithHttpInfo(body, orderId, null);
    }

    /**
     * (asynchronously) Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 2 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains
     * the usage plan rate limits for the operation, when available. The preceding table contains the default rate and
     * burst values for this operation. Selling partners whose business demands require higher throughput might have
     * higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body Request body of &#x60;confirmShipment&#x60;. (required)
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call confirmShipmentAsync(
            ConfirmShipmentRequest body, String orderId, final ApiCallback<Void> callback)
            throws ApiException, LWAException {
        return confirmShipmentAsync(body, orderId, callback, null);
    }
    /**
     * (asynchronously) Updates the shipment confirmation status for a specified order. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 2 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains
     * the usage plan rate limits for the operation, when available. The preceding table contains the default rate and
     * burst values for this operation. Selling partners whose business demands require higher throughput might have
     * higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body Request body of &#x60;confirmShipment&#x60;. (required)
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call confirmShipmentAsync(
            ConfirmShipmentRequest body, String orderId, final ApiCallback<Void> callback, String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = confirmShipmentValidateBeforeCall(body, orderId, progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-confirmShipment");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || confirmShipmentBucket.tryConsume(1)) {
            apiClient.executeAsync(call, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("confirmShipment operation exceeds rate limit");
    }
    /**
     * Build call for getOrder
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call getOrderCall(
            String orderId, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/orders/v0/orders/{orderId}"
                .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {};

        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "GET",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call getOrderValidateBeforeCall(
            String orderId, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'orderId' is set
        if (orderId == null) {
            throw new ApiException("Missing the required parameter 'orderId' when calling getOrder(Async)");
        }

        return getOrderCall(orderId, progressRequestListener);
    }

    /**
     * Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5
     * | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate limits for the
     * operation, when available. The preceding table contains the default rate and burst values for this operation.
     * Selling partners whose business demands require higher throughput might have higher rate and burst values than
     * those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return GetOrderResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderResponse getOrder(String orderId, String restrictedDataToken) throws ApiException, LWAException {
        ApiResponse<GetOrderResponse> resp = getOrderWithHttpInfo(orderId, restrictedDataToken);
        return resp.getData();
    }

    /**
     * Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5
     * | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate limits for the
     * operation, when available. The preceding table contains the default rate and burst values for this operation.
     * Selling partners whose business demands require higher throughput might have higher rate and burst values than
     * those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @return GetOrderResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderResponse getOrder(String orderId) throws ApiException, LWAException {
        ApiResponse<GetOrderResponse> resp = getOrderWithHttpInfo(orderId, null);
        return resp.getData();
    }

    /**
     * Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5
     * | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate limits for the
     * operation, when available. The preceding table contains the default rate and burst values for this operation.
     * Selling partners whose business demands require higher throughput might have higher rate and burst values than
     * those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;GetOrderResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderResponse> getOrderWithHttpInfo(String orderId, String restrictedDataToken)
            throws ApiException, LWAException {
        okhttp3.Call call = getOrderValidateBeforeCall(orderId, null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrder");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderResponse>() {}.getType();
            return apiClient.execute(call, localVarReturnType);
        } else throw new ApiException.RateLimitExceeded("getOrder operation exceeds rate limit");
    }

    /**
     * Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5
     * | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate limits for the
     * operation, when available. The preceding table contains the default rate and burst values for this operation.
     * Selling partners whose business demands require higher throughput might have higher rate and burst values than
     * those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @return ApiResponse&lt;GetOrderResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderResponse> getOrderWithHttpInfo(String orderId) throws ApiException, LWAException {
        return getOrderWithHttpInfo(orderId, null);
    }

    /**
     * (asynchronously) Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | |
     * ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate
     * limits for the operation, when available. The preceding table contains the default rate and burst values for this
     * operation. Selling partners whose business demands require higher throughput might have higher rate and burst
     * values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderAsync(String orderId, final ApiCallback<GetOrderResponse> callback)
            throws ApiException, LWAException {
        return getOrderAsync(orderId, callback, null);
    }
    /**
     * (asynchronously) Returns the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst | |
     * ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate
     * limits for the operation, when available. The preceding table contains the default rate and burst values for this
     * operation. Selling partners whose business demands require higher throughput might have higher rate and burst
     * values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderAsync(
            String orderId, final ApiCallback<GetOrderResponse> callback, String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = getOrderValidateBeforeCall(orderId, progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrder");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderResponse>() {}.getType();
            apiClient.executeAsync(call, localVarReturnType, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("getOrder operation exceeds rate limit");
    }
    /**
     * Build call for getOrderAddress
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call getOrderAddressCall(
            String orderId, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/orders/v0/orders/{orderId}/address"
                .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {};

        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "GET",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call getOrderAddressValidateBeforeCall(
            String orderId, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'orderId' is set
        if (orderId == null) {
            throw new ApiException("Missing the required parameter 'orderId' when calling getOrderAddress(Async)");
        }

        return getOrderAddressCall(orderId, progressRequestListener);
    }

    /**
     * Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst
     * | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan
     * rate limits for the operation, when available. The preceding table contains the default rate and burst values for
     * this operation. Selling partners whose business demands require higher throughput might have higher rate and
     * burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return GetOrderAddressResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderAddressResponse getOrderAddress(String orderId, String restrictedDataToken)
            throws ApiException, LWAException {
        ApiResponse<GetOrderAddressResponse> resp = getOrderAddressWithHttpInfo(orderId, restrictedDataToken);
        return resp.getData();
    }

    /**
     * Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst
     * | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan
     * rate limits for the operation, when available. The preceding table contains the default rate and burst values for
     * this operation. Selling partners whose business demands require higher throughput might have higher rate and
     * burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @return GetOrderAddressResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderAddressResponse getOrderAddress(String orderId) throws ApiException, LWAException {
        ApiResponse<GetOrderAddressResponse> resp = getOrderAddressWithHttpInfo(orderId, null);
        return resp.getData();
    }

    /**
     * Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst
     * | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan
     * rate limits for the operation, when available. The preceding table contains the default rate and burst values for
     * this operation. Selling partners whose business demands require higher throughput might have higher rate and
     * burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;GetOrderAddressResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderAddressResponse> getOrderAddressWithHttpInfo(String orderId, String restrictedDataToken)
            throws ApiException, LWAException {
        okhttp3.Call call = getOrderAddressValidateBeforeCall(orderId, null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderAddress");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderAddressBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderAddressResponse>() {}.getType();
            return apiClient.execute(call, localVarReturnType);
        } else throw new ApiException.RateLimitExceeded("getOrderAddress operation exceeds rate limit");
    }

    /**
     * Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst
     * | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan
     * rate limits for the operation, when available. The preceding table contains the default rate and burst values for
     * this operation. Selling partners whose business demands require higher throughput might have higher rate and
     * burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @return ApiResponse&lt;GetOrderAddressResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderAddressResponse> getOrderAddressWithHttpInfo(String orderId)
            throws ApiException, LWAException {
        return getOrderAddressWithHttpInfo(orderId, null);
    }

    /**
     * (asynchronously) Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header
     * contains the usage plan rate limits for the operation, when available. The preceding table contains the default
     * rate and burst values for this operation. Selling partners whose business demands require higher throughput might
     * have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderAddressAsync(String orderId, final ApiCallback<GetOrderAddressResponse> callback)
            throws ApiException, LWAException {
        return getOrderAddressAsync(orderId, callback, null);
    }
    /**
     * (asynchronously) Returns the shipping address for the order that you specify. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header
     * contains the usage plan rate limits for the operation, when available. The preceding table contains the default
     * rate and burst values for this operation. Selling partners whose business demands require higher throughput might
     * have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderAddressAsync(
            String orderId, final ApiCallback<GetOrderAddressResponse> callback, String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = getOrderAddressValidateBeforeCall(orderId, progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderAddress");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderAddressBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderAddressResponse>() {}.getType();
            apiClient.executeAsync(call, localVarReturnType, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("getOrderAddress operation exceeds rate limit");
    }
    /**
     * Build call for getOrderBuyerInfo
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call getOrderBuyerInfoCall(
            String orderId, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/orders/v0/orders/{orderId}/buyerInfo"
                .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {};

        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "GET",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call getOrderBuyerInfoValidateBeforeCall(
            String orderId, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'orderId' is set
        if (orderId == null) {
            throw new ApiException("Missing the required parameter 'orderId' when calling getOrderBuyerInfo(Async)");
        }

        return getOrderBuyerInfoCall(orderId, progressRequestListener);
    }

    /**
     * Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst |
     * | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate
     * limits for the operation, when available. The preceding table contains the default rate and burst values for this
     * operation. Selling partners whose business demands require higher throughput might have higher rate and burst
     * values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return GetOrderBuyerInfoResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderBuyerInfoResponse getOrderBuyerInfo(String orderId, String restrictedDataToken)
            throws ApiException, LWAException {
        ApiResponse<GetOrderBuyerInfoResponse> resp = getOrderBuyerInfoWithHttpInfo(orderId, restrictedDataToken);
        return resp.getData();
    }

    /**
     * Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst |
     * | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate
     * limits for the operation, when available. The preceding table contains the default rate and burst values for this
     * operation. Selling partners whose business demands require higher throughput might have higher rate and burst
     * values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @return GetOrderBuyerInfoResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderBuyerInfoResponse getOrderBuyerInfo(String orderId) throws ApiException, LWAException {
        ApiResponse<GetOrderBuyerInfoResponse> resp = getOrderBuyerInfoWithHttpInfo(orderId, null);
        return resp.getData();
    }

    /**
     * Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst |
     * | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate
     * limits for the operation, when available. The preceding table contains the default rate and burst values for this
     * operation. Selling partners whose business demands require higher throughput might have higher rate and burst
     * values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;GetOrderBuyerInfoResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderBuyerInfoResponse> getOrderBuyerInfoWithHttpInfo(
            String orderId, String restrictedDataToken) throws ApiException, LWAException {
        okhttp3.Call call = getOrderBuyerInfoValidateBeforeCall(orderId, null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderBuyerInfo");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderBuyerInfoBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderBuyerInfoResponse>() {}.getType();
            return apiClient.execute(call, localVarReturnType);
        } else throw new ApiException.RateLimitExceeded("getOrderBuyerInfo operation exceeds rate limit");
    }

    /**
     * Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per second) | Burst |
     * | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate
     * limits for the operation, when available. The preceding table contains the default rate and burst values for this
     * operation. Selling partners whose business demands require higher throughput might have higher rate and burst
     * values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @return ApiResponse&lt;GetOrderBuyerInfoResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderBuyerInfoResponse> getOrderBuyerInfoWithHttpInfo(String orderId)
            throws ApiException, LWAException {
        return getOrderBuyerInfoWithHttpInfo(orderId, null);
    }

    /**
     * (asynchronously) Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per
     * second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains
     * the usage plan rate limits for the operation, when available. The preceding table contains the default rate and
     * burst values for this operation. Selling partners whose business demands require higher throughput might have
     * higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderBuyerInfoAsync(String orderId, final ApiCallback<GetOrderBuyerInfoResponse> callback)
            throws ApiException, LWAException {
        return getOrderBuyerInfoAsync(orderId, callback, null);
    }
    /**
     * (asynchronously) Returns buyer information for the order that you specify. **Usage Plan:** | Rate (requests per
     * second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains
     * the usage plan rate limits for the operation, when available. The preceding table contains the default rate and
     * burst values for this operation. Selling partners whose business demands require higher throughput might have
     * higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderBuyerInfoAsync(
            String orderId, final ApiCallback<GetOrderBuyerInfoResponse> callback, String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = getOrderBuyerInfoValidateBeforeCall(orderId, progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderBuyerInfo");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderBuyerInfoBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderBuyerInfoResponse>() {}.getType();
            apiClient.executeAsync(call, localVarReturnType, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("getOrderBuyerInfo operation exceeds rate limit");
    }
    /**
     * Build call for getOrderItems
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call getOrderItemsCall(
            String orderId, String nextToken, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/orders/v0/orders/{orderId}/orderItems"
                .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (nextToken != null) localVarQueryParams.addAll(apiClient.parameterToPair("NextToken", nextToken));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {};

        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "GET",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call getOrderItemsValidateBeforeCall(
            String orderId, String nextToken, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'orderId' is set
        if (orderId == null) {
            throw new ApiException("Missing the required parameter 'orderId' when calling getOrderItems(Async)");
        }

        return getOrderItemsCall(orderId, nextToken, progressRequestListener);
    }

    /**
     * Returns detailed order item information for the order that you specify. If &#x60;NextToken&#x60; is provided,
     * it&#x27;s used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the
     * order has been placed but payment has not been authorized), the getOrderItems operation does not return
     * information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order.
     * After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped,
     * Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes,
     * shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header
     * contains the usage plan rate limits for the operation, when available. The preceding table contains the default
     * rate and burst values for this operation. Selling partners whose business demands require higher throughput might
     * have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return GetOrderItemsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderItemsResponse getOrderItems(String orderId, String nextToken, String restrictedDataToken)
            throws ApiException, LWAException {
        ApiResponse<GetOrderItemsResponse> resp = getOrderItemsWithHttpInfo(orderId, nextToken, restrictedDataToken);
        return resp.getData();
    }

    /**
     * Returns detailed order item information for the order that you specify. If &#x60;NextToken&#x60; is provided,
     * it&#x27;s used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the
     * order has been placed but payment has not been authorized), the getOrderItems operation does not return
     * information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order.
     * After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped,
     * Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes,
     * shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header
     * contains the usage plan rate limits for the operation, when available. The preceding table contains the default
     * rate and burst values for this operation. Selling partners whose business demands require higher throughput might
     * have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @return GetOrderItemsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderItemsResponse getOrderItems(String orderId, String nextToken) throws ApiException, LWAException {
        ApiResponse<GetOrderItemsResponse> resp = getOrderItemsWithHttpInfo(orderId, nextToken, null);
        return resp.getData();
    }

    /**
     * Returns detailed order item information for the order that you specify. If &#x60;NextToken&#x60; is provided,
     * it&#x27;s used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the
     * order has been placed but payment has not been authorized), the getOrderItems operation does not return
     * information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order.
     * After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped,
     * Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes,
     * shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header
     * contains the usage plan rate limits for the operation, when available. The preceding table contains the default
     * rate and burst values for this operation. Selling partners whose business demands require higher throughput might
     * have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;GetOrderItemsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderItemsResponse> getOrderItemsWithHttpInfo(
            String orderId, String nextToken, String restrictedDataToken) throws ApiException, LWAException {
        okhttp3.Call call = getOrderItemsValidateBeforeCall(orderId, nextToken, null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderItems");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderItemsBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderItemsResponse>() {}.getType();
            return apiClient.execute(call, localVarReturnType);
        } else throw new ApiException.RateLimitExceeded("getOrderItems operation exceeds rate limit");
    }

    /**
     * Returns detailed order item information for the order that you specify. If &#x60;NextToken&#x60; is provided,
     * it&#x27;s used to retrieve the next page of order items. __Note__: When an order is in the Pending state (the
     * order has been placed but payment has not been authorized), the getOrderItems operation does not return
     * information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order.
     * After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped,
     * Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes,
     * shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header
     * contains the usage plan rate limits for the operation, when available. The preceding table contains the default
     * rate and burst values for this operation. Selling partners whose business demands require higher throughput might
     * have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @return ApiResponse&lt;GetOrderItemsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderItemsResponse> getOrderItemsWithHttpInfo(String orderId, String nextToken)
            throws ApiException, LWAException {
        return getOrderItemsWithHttpInfo(orderId, nextToken, null);
    }

    /**
     * (asynchronously) Returns detailed order item information for the order that you specify. If &#x60;NextToken&#x60;
     * is provided, it&#x27;s used to retrieve the next page of order items. __Note__: When an order is in the Pending
     * state (the order has been placed but payment has not been authorized), the getOrderItems operation does not
     * return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the
     * order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the
     * Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing,
     * taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate
     * (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response
     * header contains the usage plan rate limits for the operation, when available. The preceding table contains the
     * default rate and burst values for this operation. Selling partners whose business demands require higher
     * throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage
     * Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderItemsAsync(
            String orderId, String nextToken, final ApiCallback<GetOrderItemsResponse> callback)
            throws ApiException, LWAException {
        return getOrderItemsAsync(orderId, nextToken, callback, null);
    }
    /**
     * (asynchronously) Returns detailed order item information for the order that you specify. If &#x60;NextToken&#x60;
     * is provided, it&#x27;s used to retrieve the next page of order items. __Note__: When an order is in the Pending
     * state (the order has been placed but payment has not been authorized), the getOrderItems operation does not
     * return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the
     * order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the
     * Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing,
     * taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plan:** | Rate
     * (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response
     * header contains the usage plan rate limits for the operation, when available. The preceding table contains the
     * default rate and burst values for this operation. Selling partners whose business demands require higher
     * throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage
     * Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderItemsAsync(
            String orderId,
            String nextToken,
            final ApiCallback<GetOrderItemsResponse> callback,
            String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = getOrderItemsValidateBeforeCall(orderId, nextToken, progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderItems");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderItemsBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderItemsResponse>() {}.getType();
            apiClient.executeAsync(call, localVarReturnType, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("getOrderItems operation exceeds rate limit");
    }
    /**
     * Build call for getOrderItemsBuyerInfo
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call getOrderItemsBuyerInfoCall(
            String orderId, String nextToken, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/orders/v0/orders/{orderId}/orderItems/buyerInfo"
                .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (nextToken != null) localVarQueryParams.addAll(apiClient.parameterToPair("NextToken", nextToken));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {};

        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "GET",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call getOrderItemsBuyerInfoValidateBeforeCall(
            String orderId, String nextToken, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'orderId' is set
        if (orderId == null) {
            throw new ApiException(
                    "Missing the required parameter 'orderId' when calling getOrderItemsBuyerInfo(Async)");
        }

        return getOrderItemsBuyerInfoCall(orderId, nextToken, progressRequestListener);
    }

    /**
     * Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per
     * second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains
     * the usage plan rate limits for the operation, when available. The preceding table contains the default rate and
     * burst values for this operation. Selling partners whose business demands require higher throughput might have
     * higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return GetOrderItemsBuyerInfoResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderItemsBuyerInfoResponse getOrderItemsBuyerInfo(
            String orderId, String nextToken, String restrictedDataToken) throws ApiException, LWAException {
        ApiResponse<GetOrderItemsBuyerInfoResponse> resp =
                getOrderItemsBuyerInfoWithHttpInfo(orderId, nextToken, restrictedDataToken);
        return resp.getData();
    }

    /**
     * Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per
     * second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains
     * the usage plan rate limits for the operation, when available. The preceding table contains the default rate and
     * burst values for this operation. Selling partners whose business demands require higher throughput might have
     * higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @return GetOrderItemsBuyerInfoResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderItemsBuyerInfoResponse getOrderItemsBuyerInfo(String orderId, String nextToken)
            throws ApiException, LWAException {
        ApiResponse<GetOrderItemsBuyerInfoResponse> resp = getOrderItemsBuyerInfoWithHttpInfo(orderId, nextToken, null);
        return resp.getData();
    }

    /**
     * Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per
     * second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains
     * the usage plan rate limits for the operation, when available. The preceding table contains the default rate and
     * burst values for this operation. Selling partners whose business demands require higher throughput might have
     * higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;GetOrderItemsBuyerInfoResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderItemsBuyerInfoResponse> getOrderItemsBuyerInfoWithHttpInfo(
            String orderId, String nextToken, String restrictedDataToken) throws ApiException, LWAException {
        okhttp3.Call call = getOrderItemsBuyerInfoValidateBeforeCall(orderId, nextToken, null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request =
                    RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderItemsBuyerInfo");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderItemsBuyerInfoBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderItemsBuyerInfoResponse>() {}.getType();
            return apiClient.execute(call, localVarReturnType);
        } else throw new ApiException.RateLimitExceeded("getOrderItemsBuyerInfo operation exceeds rate limit");
    }

    /**
     * Returns buyer information for the order items in the order that you specify. **Usage Plan:** | Rate (requests per
     * second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains
     * the usage plan rate limits for the operation, when available. The preceding table contains the default rate and
     * burst values for this operation. Selling partners whose business demands require higher throughput might have
     * higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @return ApiResponse&lt;GetOrderItemsBuyerInfoResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderItemsBuyerInfoResponse> getOrderItemsBuyerInfoWithHttpInfo(
            String orderId, String nextToken) throws ApiException, LWAException {
        return getOrderItemsBuyerInfoWithHttpInfo(orderId, nextToken, null);
    }

    /**
     * (asynchronously) Returns buyer information for the order items in the order that you specify. **Usage Plan:** |
     * Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response
     * header contains the usage plan rate limits for the operation, when available. The preceding table contains the
     * default rate and burst values for this operation. Selling partners whose business demands require higher
     * throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage
     * Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderItemsBuyerInfoAsync(
            String orderId, String nextToken, final ApiCallback<GetOrderItemsBuyerInfoResponse> callback)
            throws ApiException, LWAException {
        return getOrderItemsBuyerInfoAsync(orderId, nextToken, callback, null);
    }
    /**
     * (asynchronously) Returns buyer information for the order items in the order that you specify. **Usage Plan:** |
     * Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response
     * header contains the usage plan rate limits for the operation, when available. The preceding table contains the
     * default rate and burst values for this operation. Selling partners whose business demands require higher
     * throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage
     * Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId An Amazon-defined order identifier, in 3-7-7 format. (required)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderItemsBuyerInfoAsync(
            String orderId,
            String nextToken,
            final ApiCallback<GetOrderItemsBuyerInfoResponse> callback,
            String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = getOrderItemsBuyerInfoValidateBeforeCall(orderId, nextToken, progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request =
                    RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderItemsBuyerInfo");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderItemsBuyerInfoBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderItemsBuyerInfoResponse>() {}.getType();
            apiClient.executeAsync(call, localVarReturnType, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("getOrderItemsBuyerInfo operation exceeds rate limit");
    }
    /**
     * Build call for getOrderRegulatedInfo
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call getOrderRegulatedInfoCall(
            String orderId, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/orders/v0/orders/{orderId}/regulatedInfo"
                .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json", "PendingOrder", "ApprovedOrder", "RejectedOrder"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {};

        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "GET",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call getOrderRegulatedInfoValidateBeforeCall(
            String orderId, final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'orderId' is set
        if (orderId == null) {
            throw new ApiException(
                    "Missing the required parameter 'orderId' when calling getOrderRegulatedInfo(Async)");
        }

        return getOrderRegulatedInfoCall(orderId, progressRequestListener);
    }

    /**
     * Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) |
     * Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage
     * plan rate limits for the operation, when available. The preceding table contains the default rate and burst
     * values for this operation. Selling partners whose business demands require higher throughput might have higher
     * rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return GetOrderRegulatedInfoResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderRegulatedInfoResponse getOrderRegulatedInfo(String orderId, String restrictedDataToken)
            throws ApiException, LWAException {
        ApiResponse<GetOrderRegulatedInfoResponse> resp =
                getOrderRegulatedInfoWithHttpInfo(orderId, restrictedDataToken);
        return resp.getData();
    }

    /**
     * Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) |
     * Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage
     * plan rate limits for the operation, when available. The preceding table contains the default rate and burst
     * values for this operation. Selling partners whose business demands require higher throughput might have higher
     * rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @return GetOrderRegulatedInfoResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrderRegulatedInfoResponse getOrderRegulatedInfo(String orderId) throws ApiException, LWAException {
        ApiResponse<GetOrderRegulatedInfoResponse> resp = getOrderRegulatedInfoWithHttpInfo(orderId, null);
        return resp.getData();
    }

    /**
     * Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) |
     * Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage
     * plan rate limits for the operation, when available. The preceding table contains the default rate and burst
     * values for this operation. Selling partners whose business demands require higher throughput might have higher
     * rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;GetOrderRegulatedInfoResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderRegulatedInfoResponse> getOrderRegulatedInfoWithHttpInfo(
            String orderId, String restrictedDataToken) throws ApiException, LWAException {
        okhttp3.Call call = getOrderRegulatedInfoValidateBeforeCall(orderId, null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderRegulatedInfo");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderRegulatedInfoBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderRegulatedInfoResponse>() {}.getType();
            return apiClient.execute(call, localVarReturnType);
        } else throw new ApiException.RateLimitExceeded("getOrderRegulatedInfo operation exceeds rate limit");
    }

    /**
     * Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests per second) |
     * Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage
     * plan rate limits for the operation, when available. The preceding table contains the default rate and burst
     * values for this operation. Selling partners whose business demands require higher throughput might have higher
     * rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @return ApiResponse&lt;GetOrderRegulatedInfoResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrderRegulatedInfoResponse> getOrderRegulatedInfoWithHttpInfo(String orderId)
            throws ApiException, LWAException {
        return getOrderRegulatedInfoWithHttpInfo(orderId, null);
    }

    /**
     * (asynchronously) Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header
     * contains the usage plan rate limits for the operation, when available. The preceding table contains the default
     * rate and burst values for this operation. Selling partners whose business demands require higher throughput might
     * have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderRegulatedInfoAsync(
            String orderId, final ApiCallback<GetOrderRegulatedInfoResponse> callback)
            throws ApiException, LWAException {
        return getOrderRegulatedInfoAsync(orderId, callback, null);
    }
    /**
     * (asynchronously) Returns regulated information for the order that you specify. **Usage Plan:** | Rate (requests
     * per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header
     * contains the usage plan rate limits for the operation, when available. The preceding table contains the default
     * rate and burst values for this operation. Selling partners whose business demands require higher throughput might
     * have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrderRegulatedInfoAsync(
            String orderId, final ApiCallback<GetOrderRegulatedInfoResponse> callback, String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = getOrderRegulatedInfoValidateBeforeCall(orderId, progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrderRegulatedInfo");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrderRegulatedInfoBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrderRegulatedInfoResponse>() {}.getType();
            apiClient.executeAsync(call, localVarReturnType, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("getOrderRegulatedInfo operation exceeds rate limit");
    }
    /**
     * Build call for getOrders
     *
     * @param marketplaceIds A list of &#x60;MarketplaceId&#x60; values. Used to select orders that were placed in the
     *     specified marketplaces. Refer to [Marketplace
     *     IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of
     *     &#x60;marketplaceId&#x60; values. (required)
     * @param createdAfter Use this date to select orders created after (or at) a specified time. Only orders placed
     *     after the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;LastUpdatedAfter&#x60; and &#x60;LastUpdatedBefore&#x60; cannot be set when
     *     &#x60;CreatedAfter&#x60; is set. (optional)
     * @param createdBefore Use this date to select orders created before (or at) a specified time. Only orders placed
     *     before the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;CreatedBefore&#x60; is
     *     optional when &#x60;CreatedAfter&#x60; is set. If specified, &#x60;CreatedBefore&#x60; must be equal to or
     *     after the &#x60;CreatedAfter&#x60; date and at least two minutes before current time. (optional)
     * @param lastUpdatedAfter Use this date to select orders that were last updated after (or at) a specified time. An
     *     update is defined as any change in order status, including the creation of a new order. Includes updates made
     *     by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;CreatedAfter&#x60; or &#x60;CreatedBefore&#x60; cannot be set when &#x60;LastUpdatedAfter&#x60;
     *     is set. (optional)
     * @param lastUpdatedBefore Use this date to select orders that were last updated before (or at) a specified time.
     *     An update is defined as any change in order status, including the creation of a new order. Includes updates
     *     made by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;LastUpdatedBefore&#x60;
     *     is optional when &#x60;LastUpdatedAfter&#x60; is set. But if specified, &#x60;LastUpdatedBefore&#x60; must be
     *     equal to or after the &#x60;LastUpdatedAfter&#x60; date and at least two minutes before current time.
     *     (optional)
     * @param orderStatuses A list of &#x60;OrderStatus&#x60; values used to filter the results. **Possible values:** -
     *     &#x60;PendingAvailability&#x60; (This status is available for pre-orders only. The order has been placed,
     *     payment has not been authorized, and the release date of the item is in the future.) - &#x60;Pending&#x60;
     *     (The order has been placed but payment has not been authorized.) - &#x60;Unshipped&#x60; (Payment has been
     *     authorized and the order is ready for shipment, but no items in the order have been shipped.) -
     *     &#x60;PartiallyShipped&#x60; (One or more, but not all, items in the order have been shipped.) -
     *     &#x60;Shipped&#x60; (All items in the order have been shipped.) - &#x60;InvoiceUnconfirmed&#x60; (All items
     *     in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been
     *     shipped to the buyer.) - &#x60;Canceled&#x60; (The order has been canceled.) - &#x60;Unfulfillable&#x60; (The
     *     order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) (optional)
     * @param fulfillmentChannels A list that indicates how an order was fulfilled. Filters the results by fulfillment
     *     channel. **Possible values**: &#x60;AFN&#x60; (fulfilled by Amazon), &#x60;MFN&#x60; (fulfilled by seller).
     *     (optional)
     * @param paymentMethods A list of payment method values. Use this field to select orders that were paid with the
     *     specified payment methods. **Possible values**: &#x60;COD&#x60; (cash on delivery), &#x60;CVS&#x60;
     *     (convenience store), &#x60;Other&#x60; (Any payment method other than COD or CVS). (optional)
     * @param buyerEmail The email address of a buyer. Used to select orders that contain the specified email address.
     *     (optional)
     * @param sellerOrderId An order identifier that is specified by the seller. Used to select only the orders that
     *     match the order identifier. If &#x60;SellerOrderId&#x60; is specified, then &#x60;FulfillmentChannels&#x60;,
     *     &#x60;OrderStatuses&#x60;, &#x60;PaymentMethod&#x60;, &#x60;LastUpdatedAfter&#x60;, LastUpdatedBefore, and
     *     &#x60;BuyerEmail&#x60; cannot be specified. (optional)
     * @param maxResultsPerPage A number that indicates the maximum number of orders that can be returned per page.
     *     Value must be 1 - 100. Default 100. (optional)
     * @param easyShipShipmentStatuses A list of &#x60;EasyShipShipmentStatus&#x60; values. Used to select Easy Ship
     *     orders with statuses that match the specified values. If &#x60;EasyShipShipmentStatus&#x60; is specified,
     *     only Amazon Easy Ship orders are returned. **Possible values:** - &#x60;PendingSchedule&#x60; (The package is
     *     awaiting the schedule for pick-up.) - &#x60;PendingPickUp&#x60; (Amazon has not yet picked up the package
     *     from the seller.) - &#x60;PendingDropOff&#x60; (The seller will deliver the package to the carrier.) -
     *     &#x60;LabelCanceled&#x60; (The seller canceled the pickup.) - &#x60;PickedUp&#x60; (Amazon has picked up the
     *     package from the seller.) - &#x60;DroppedOff&#x60; (The package is delivered to the carrier by the seller.) -
     *     &#x60;AtOriginFC&#x60; (The packaged is at the origin fulfillment center.) - &#x60;AtDestinationFC&#x60; (The
     *     package is at the destination fulfillment center.) - &#x60;Delivered&#x60; (The package has been delivered.)
     *     - &#x60;RejectedByBuyer&#x60; (The package has been rejected by the buyer.) - &#x60;Undeliverable&#x60; (The
     *     package cannot be delivered.) - &#x60;ReturningToSeller&#x60; (The package was not delivered and is being
     *     returned to the seller.) - &#x60;ReturnedToSeller&#x60; (The package was not delivered and was returned to
     *     the seller.) - &#x60;Lost&#x60; (The package is lost.) - &#x60;OutForDelivery&#x60; (The package is out for
     *     delivery.) - &#x60;Damaged&#x60; (The package was damaged by the carrier.) (optional)
     * @param electronicInvoiceStatuses A list of &#x60;ElectronicInvoiceStatus&#x60; values. Used to select orders with
     *     electronic invoice statuses that match the specified values. **Possible values:** - &#x60;NotRequired&#x60;
     *     (Electronic invoice submission is not required for this order.) - &#x60;NotFound&#x60; (The electronic
     *     invoice was not submitted for this order.) - &#x60;Processing&#x60; (The electronic invoice is being
     *     processed for this order.) - &#x60;Errored&#x60; (The last submitted electronic invoice was rejected for this
     *     order.) - &#x60;Accepted&#x60; (The last submitted electronic invoice was submitted and accepted.) (optional)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param amazonOrderIds A list of &#x60;AmazonOrderId&#x60; values. An &#x60;AmazonOrderId&#x60; is an
     *     Amazon-defined order identifier, in 3-7-7 format. (optional)
     * @param actualFulfillmentSupplySourceId The &#x60;sourceId&#x60; of the location from where you want the order
     *     fulfilled. (optional)
     * @param isISPU When true, this order is marked to be picked up from a store rather than delivered. (optional)
     * @param storeChainStoreId The store chain store identifier. Linked to a specific store in a store chain.
     *     (optional)
     * @param earliestDeliveryDateBefore Use this date to select orders with a earliest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param earliestDeliveryDateAfter Use this date to select orders with a earliest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateBefore Use this date to select orders with a latest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateAfter Use this date to select orders with a latest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call getOrdersCall(
            List<String> marketplaceIds,
            String createdAfter,
            String createdBefore,
            String lastUpdatedAfter,
            String lastUpdatedBefore,
            List<String> orderStatuses,
            List<String> fulfillmentChannels,
            List<String> paymentMethods,
            String buyerEmail,
            String sellerOrderId,
            Integer maxResultsPerPage,
            List<String> easyShipShipmentStatuses,
            List<String> electronicInvoiceStatuses,
            String nextToken,
            List<String> amazonOrderIds,
            String actualFulfillmentSupplySourceId,
            Boolean isISPU,
            String storeChainStoreId,
            String earliestDeliveryDateBefore,
            String earliestDeliveryDateAfter,
            String latestDeliveryDateBefore,
            String latestDeliveryDateAfter,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/orders/v0/orders";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (createdAfter != null) localVarQueryParams.addAll(apiClient.parameterToPair("CreatedAfter", createdAfter));
        if (createdBefore != null)
            localVarQueryParams.addAll(apiClient.parameterToPair("CreatedBefore", createdBefore));
        if (lastUpdatedAfter != null)
            localVarQueryParams.addAll(apiClient.parameterToPair("LastUpdatedAfter", lastUpdatedAfter));
        if (lastUpdatedBefore != null)
            localVarQueryParams.addAll(apiClient.parameterToPair("LastUpdatedBefore", lastUpdatedBefore));
        if (orderStatuses != null)
            localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "OrderStatuses", orderStatuses));
        if (marketplaceIds != null)
            localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "MarketplaceIds", marketplaceIds));
        if (fulfillmentChannels != null)
            localVarCollectionQueryParams.addAll(
                    apiClient.parameterToPairs("csv", "FulfillmentChannels", fulfillmentChannels));
        if (paymentMethods != null)
            localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "PaymentMethods", paymentMethods));
        if (buyerEmail != null) localVarQueryParams.addAll(apiClient.parameterToPair("BuyerEmail", buyerEmail));
        if (sellerOrderId != null)
            localVarQueryParams.addAll(apiClient.parameterToPair("SellerOrderId", sellerOrderId));
        if (maxResultsPerPage != null)
            localVarQueryParams.addAll(apiClient.parameterToPair("MaxResultsPerPage", maxResultsPerPage));
        if (easyShipShipmentStatuses != null)
            localVarCollectionQueryParams.addAll(
                    apiClient.parameterToPairs("csv", "EasyShipShipmentStatuses", easyShipShipmentStatuses));
        if (electronicInvoiceStatuses != null)
            localVarCollectionQueryParams.addAll(
                    apiClient.parameterToPairs("csv", "ElectronicInvoiceStatuses", electronicInvoiceStatuses));
        if (nextToken != null) localVarQueryParams.addAll(apiClient.parameterToPair("NextToken", nextToken));
        if (amazonOrderIds != null)
            localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "AmazonOrderIds", amazonOrderIds));
        if (actualFulfillmentSupplySourceId != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPair("ActualFulfillmentSupplySourceId", actualFulfillmentSupplySourceId));
        if (isISPU != null) localVarQueryParams.addAll(apiClient.parameterToPair("IsISPU", isISPU));
        if (storeChainStoreId != null)
            localVarQueryParams.addAll(apiClient.parameterToPair("StoreChainStoreId", storeChainStoreId));
        if (earliestDeliveryDateBefore != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPair("EarliestDeliveryDateBefore", earliestDeliveryDateBefore));
        if (earliestDeliveryDateAfter != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPair("EarliestDeliveryDateAfter", earliestDeliveryDateAfter));
        if (latestDeliveryDateBefore != null)
            localVarQueryParams.addAll(apiClient.parameterToPair("LatestDeliveryDateBefore", latestDeliveryDateBefore));
        if (latestDeliveryDateAfter != null)
            localVarQueryParams.addAll(apiClient.parameterToPair("LatestDeliveryDateAfter", latestDeliveryDateAfter));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {};

        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "GET",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call getOrdersValidateBeforeCall(
            List<String> marketplaceIds,
            String createdAfter,
            String createdBefore,
            String lastUpdatedAfter,
            String lastUpdatedBefore,
            List<String> orderStatuses,
            List<String> fulfillmentChannels,
            List<String> paymentMethods,
            String buyerEmail,
            String sellerOrderId,
            Integer maxResultsPerPage,
            List<String> easyShipShipmentStatuses,
            List<String> electronicInvoiceStatuses,
            String nextToken,
            List<String> amazonOrderIds,
            String actualFulfillmentSupplySourceId,
            Boolean isISPU,
            String storeChainStoreId,
            String earliestDeliveryDateBefore,
            String earliestDeliveryDateAfter,
            String latestDeliveryDateBefore,
            String latestDeliveryDateAfter,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'marketplaceIds' is set
        if (marketplaceIds == null) {
            throw new ApiException("Missing the required parameter 'marketplaceIds' when calling getOrders(Async)");
        }

        return getOrdersCall(
                marketplaceIds,
                createdAfter,
                createdBefore,
                lastUpdatedAfter,
                lastUpdatedBefore,
                orderStatuses,
                fulfillmentChannels,
                paymentMethods,
                buyerEmail,
                sellerOrderId,
                maxResultsPerPage,
                easyShipShipmentStatuses,
                electronicInvoiceStatuses,
                nextToken,
                amazonOrderIds,
                actualFulfillmentSupplySourceId,
                isISPU,
                storeChainStoreId,
                earliestDeliveryDateBefore,
                earliestDeliveryDateAfter,
                latestDeliveryDateBefore,
                latestDeliveryDateAfter,
                progressRequestListener);
    }

    /**
     * Returns orders that are created or updated during the specified time period. If you want to return specific types
     * of orders, you can apply filters to your request. &#x60;NextToken&#x60; doesn&#x27;t affect any filters that you
     * include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate
     * (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The &#x60;x-amzn-RateLimit-Limit&#x60; response
     * header contains the usage plan rate limits for the operation, when available. The preceding table contains the
     * default rate and burst values for this operation. Selling partners whose business demands require higher
     * throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage
     * Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param marketplaceIds A list of &#x60;MarketplaceId&#x60; values. Used to select orders that were placed in the
     *     specified marketplaces. Refer to [Marketplace
     *     IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of
     *     &#x60;marketplaceId&#x60; values. (required)
     * @param createdAfter Use this date to select orders created after (or at) a specified time. Only orders placed
     *     after the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;LastUpdatedAfter&#x60; and &#x60;LastUpdatedBefore&#x60; cannot be set when
     *     &#x60;CreatedAfter&#x60; is set. (optional)
     * @param createdBefore Use this date to select orders created before (or at) a specified time. Only orders placed
     *     before the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;CreatedBefore&#x60; is
     *     optional when &#x60;CreatedAfter&#x60; is set. If specified, &#x60;CreatedBefore&#x60; must be equal to or
     *     after the &#x60;CreatedAfter&#x60; date and at least two minutes before current time. (optional)
     * @param lastUpdatedAfter Use this date to select orders that were last updated after (or at) a specified time. An
     *     update is defined as any change in order status, including the creation of a new order. Includes updates made
     *     by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;CreatedAfter&#x60; or &#x60;CreatedBefore&#x60; cannot be set when &#x60;LastUpdatedAfter&#x60;
     *     is set. (optional)
     * @param lastUpdatedBefore Use this date to select orders that were last updated before (or at) a specified time.
     *     An update is defined as any change in order status, including the creation of a new order. Includes updates
     *     made by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;LastUpdatedBefore&#x60;
     *     is optional when &#x60;LastUpdatedAfter&#x60; is set. But if specified, &#x60;LastUpdatedBefore&#x60; must be
     *     equal to or after the &#x60;LastUpdatedAfter&#x60; date and at least two minutes before current time.
     *     (optional)
     * @param orderStatuses A list of &#x60;OrderStatus&#x60; values used to filter the results. **Possible values:** -
     *     &#x60;PendingAvailability&#x60; (This status is available for pre-orders only. The order has been placed,
     *     payment has not been authorized, and the release date of the item is in the future.) - &#x60;Pending&#x60;
     *     (The order has been placed but payment has not been authorized.) - &#x60;Unshipped&#x60; (Payment has been
     *     authorized and the order is ready for shipment, but no items in the order have been shipped.) -
     *     &#x60;PartiallyShipped&#x60; (One or more, but not all, items in the order have been shipped.) -
     *     &#x60;Shipped&#x60; (All items in the order have been shipped.) - &#x60;InvoiceUnconfirmed&#x60; (All items
     *     in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been
     *     shipped to the buyer.) - &#x60;Canceled&#x60; (The order has been canceled.) - &#x60;Unfulfillable&#x60; (The
     *     order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) (optional)
     * @param fulfillmentChannels A list that indicates how an order was fulfilled. Filters the results by fulfillment
     *     channel. **Possible values**: &#x60;AFN&#x60; (fulfilled by Amazon), &#x60;MFN&#x60; (fulfilled by seller).
     *     (optional)
     * @param paymentMethods A list of payment method values. Use this field to select orders that were paid with the
     *     specified payment methods. **Possible values**: &#x60;COD&#x60; (cash on delivery), &#x60;CVS&#x60;
     *     (convenience store), &#x60;Other&#x60; (Any payment method other than COD or CVS). (optional)
     * @param buyerEmail The email address of a buyer. Used to select orders that contain the specified email address.
     *     (optional)
     * @param sellerOrderId An order identifier that is specified by the seller. Used to select only the orders that
     *     match the order identifier. If &#x60;SellerOrderId&#x60; is specified, then &#x60;FulfillmentChannels&#x60;,
     *     &#x60;OrderStatuses&#x60;, &#x60;PaymentMethod&#x60;, &#x60;LastUpdatedAfter&#x60;, LastUpdatedBefore, and
     *     &#x60;BuyerEmail&#x60; cannot be specified. (optional)
     * @param maxResultsPerPage A number that indicates the maximum number of orders that can be returned per page.
     *     Value must be 1 - 100. Default 100. (optional)
     * @param easyShipShipmentStatuses A list of &#x60;EasyShipShipmentStatus&#x60; values. Used to select Easy Ship
     *     orders with statuses that match the specified values. If &#x60;EasyShipShipmentStatus&#x60; is specified,
     *     only Amazon Easy Ship orders are returned. **Possible values:** - &#x60;PendingSchedule&#x60; (The package is
     *     awaiting the schedule for pick-up.) - &#x60;PendingPickUp&#x60; (Amazon has not yet picked up the package
     *     from the seller.) - &#x60;PendingDropOff&#x60; (The seller will deliver the package to the carrier.) -
     *     &#x60;LabelCanceled&#x60; (The seller canceled the pickup.) - &#x60;PickedUp&#x60; (Amazon has picked up the
     *     package from the seller.) - &#x60;DroppedOff&#x60; (The package is delivered to the carrier by the seller.) -
     *     &#x60;AtOriginFC&#x60; (The packaged is at the origin fulfillment center.) - &#x60;AtDestinationFC&#x60; (The
     *     package is at the destination fulfillment center.) - &#x60;Delivered&#x60; (The package has been delivered.)
     *     - &#x60;RejectedByBuyer&#x60; (The package has been rejected by the buyer.) - &#x60;Undeliverable&#x60; (The
     *     package cannot be delivered.) - &#x60;ReturningToSeller&#x60; (The package was not delivered and is being
     *     returned to the seller.) - &#x60;ReturnedToSeller&#x60; (The package was not delivered and was returned to
     *     the seller.) - &#x60;Lost&#x60; (The package is lost.) - &#x60;OutForDelivery&#x60; (The package is out for
     *     delivery.) - &#x60;Damaged&#x60; (The package was damaged by the carrier.) (optional)
     * @param electronicInvoiceStatuses A list of &#x60;ElectronicInvoiceStatus&#x60; values. Used to select orders with
     *     electronic invoice statuses that match the specified values. **Possible values:** - &#x60;NotRequired&#x60;
     *     (Electronic invoice submission is not required for this order.) - &#x60;NotFound&#x60; (The electronic
     *     invoice was not submitted for this order.) - &#x60;Processing&#x60; (The electronic invoice is being
     *     processed for this order.) - &#x60;Errored&#x60; (The last submitted electronic invoice was rejected for this
     *     order.) - &#x60;Accepted&#x60; (The last submitted electronic invoice was submitted and accepted.) (optional)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param amazonOrderIds A list of &#x60;AmazonOrderId&#x60; values. An &#x60;AmazonOrderId&#x60; is an
     *     Amazon-defined order identifier, in 3-7-7 format. (optional)
     * @param actualFulfillmentSupplySourceId The &#x60;sourceId&#x60; of the location from where you want the order
     *     fulfilled. (optional)
     * @param isISPU When true, this order is marked to be picked up from a store rather than delivered. (optional)
     * @param storeChainStoreId The store chain store identifier. Linked to a specific store in a store chain.
     *     (optional)
     * @param earliestDeliveryDateBefore Use this date to select orders with a earliest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param earliestDeliveryDateAfter Use this date to select orders with a earliest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateBefore Use this date to select orders with a latest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateAfter Use this date to select orders with a latest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return GetOrdersResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrdersResponse getOrders(
            List<String> marketplaceIds,
            String createdAfter,
            String createdBefore,
            String lastUpdatedAfter,
            String lastUpdatedBefore,
            List<String> orderStatuses,
            List<String> fulfillmentChannels,
            List<String> paymentMethods,
            String buyerEmail,
            String sellerOrderId,
            Integer maxResultsPerPage,
            List<String> easyShipShipmentStatuses,
            List<String> electronicInvoiceStatuses,
            String nextToken,
            List<String> amazonOrderIds,
            String actualFulfillmentSupplySourceId,
            Boolean isISPU,
            String storeChainStoreId,
            String earliestDeliveryDateBefore,
            String earliestDeliveryDateAfter,
            String latestDeliveryDateBefore,
            String latestDeliveryDateAfter,
            String restrictedDataToken)
            throws ApiException, LWAException {
        ApiResponse<GetOrdersResponse> resp = getOrdersWithHttpInfo(
                marketplaceIds,
                createdAfter,
                createdBefore,
                lastUpdatedAfter,
                lastUpdatedBefore,
                orderStatuses,
                fulfillmentChannels,
                paymentMethods,
                buyerEmail,
                sellerOrderId,
                maxResultsPerPage,
                easyShipShipmentStatuses,
                electronicInvoiceStatuses,
                nextToken,
                amazonOrderIds,
                actualFulfillmentSupplySourceId,
                isISPU,
                storeChainStoreId,
                earliestDeliveryDateBefore,
                earliestDeliveryDateAfter,
                latestDeliveryDateBefore,
                latestDeliveryDateAfter,
                restrictedDataToken);
        return resp.getData();
    }

    /**
     * Returns orders that are created or updated during the specified time period. If you want to return specific types
     * of orders, you can apply filters to your request. &#x60;NextToken&#x60; doesn&#x27;t affect any filters that you
     * include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate
     * (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The &#x60;x-amzn-RateLimit-Limit&#x60; response
     * header contains the usage plan rate limits for the operation, when available. The preceding table contains the
     * default rate and burst values for this operation. Selling partners whose business demands require higher
     * throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage
     * Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param marketplaceIds A list of &#x60;MarketplaceId&#x60; values. Used to select orders that were placed in the
     *     specified marketplaces. Refer to [Marketplace
     *     IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of
     *     &#x60;marketplaceId&#x60; values. (required)
     * @param createdAfter Use this date to select orders created after (or at) a specified time. Only orders placed
     *     after the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;LastUpdatedAfter&#x60; and &#x60;LastUpdatedBefore&#x60; cannot be set when
     *     &#x60;CreatedAfter&#x60; is set. (optional)
     * @param createdBefore Use this date to select orders created before (or at) a specified time. Only orders placed
     *     before the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;CreatedBefore&#x60; is
     *     optional when &#x60;CreatedAfter&#x60; is set. If specified, &#x60;CreatedBefore&#x60; must be equal to or
     *     after the &#x60;CreatedAfter&#x60; date and at least two minutes before current time. (optional)
     * @param lastUpdatedAfter Use this date to select orders that were last updated after (or at) a specified time. An
     *     update is defined as any change in order status, including the creation of a new order. Includes updates made
     *     by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;CreatedAfter&#x60; or &#x60;CreatedBefore&#x60; cannot be set when &#x60;LastUpdatedAfter&#x60;
     *     is set. (optional)
     * @param lastUpdatedBefore Use this date to select orders that were last updated before (or at) a specified time.
     *     An update is defined as any change in order status, including the creation of a new order. Includes updates
     *     made by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;LastUpdatedBefore&#x60;
     *     is optional when &#x60;LastUpdatedAfter&#x60; is set. But if specified, &#x60;LastUpdatedBefore&#x60; must be
     *     equal to or after the &#x60;LastUpdatedAfter&#x60; date and at least two minutes before current time.
     *     (optional)
     * @param orderStatuses A list of &#x60;OrderStatus&#x60; values used to filter the results. **Possible values:** -
     *     &#x60;PendingAvailability&#x60; (This status is available for pre-orders only. The order has been placed,
     *     payment has not been authorized, and the release date of the item is in the future.) - &#x60;Pending&#x60;
     *     (The order has been placed but payment has not been authorized.) - &#x60;Unshipped&#x60; (Payment has been
     *     authorized and the order is ready for shipment, but no items in the order have been shipped.) -
     *     &#x60;PartiallyShipped&#x60; (One or more, but not all, items in the order have been shipped.) -
     *     &#x60;Shipped&#x60; (All items in the order have been shipped.) - &#x60;InvoiceUnconfirmed&#x60; (All items
     *     in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been
     *     shipped to the buyer.) - &#x60;Canceled&#x60; (The order has been canceled.) - &#x60;Unfulfillable&#x60; (The
     *     order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) (optional)
     * @param fulfillmentChannels A list that indicates how an order was fulfilled. Filters the results by fulfillment
     *     channel. **Possible values**: &#x60;AFN&#x60; (fulfilled by Amazon), &#x60;MFN&#x60; (fulfilled by seller).
     *     (optional)
     * @param paymentMethods A list of payment method values. Use this field to select orders that were paid with the
     *     specified payment methods. **Possible values**: &#x60;COD&#x60; (cash on delivery), &#x60;CVS&#x60;
     *     (convenience store), &#x60;Other&#x60; (Any payment method other than COD or CVS). (optional)
     * @param buyerEmail The email address of a buyer. Used to select orders that contain the specified email address.
     *     (optional)
     * @param sellerOrderId An order identifier that is specified by the seller. Used to select only the orders that
     *     match the order identifier. If &#x60;SellerOrderId&#x60; is specified, then &#x60;FulfillmentChannels&#x60;,
     *     &#x60;OrderStatuses&#x60;, &#x60;PaymentMethod&#x60;, &#x60;LastUpdatedAfter&#x60;, LastUpdatedBefore, and
     *     &#x60;BuyerEmail&#x60; cannot be specified. (optional)
     * @param maxResultsPerPage A number that indicates the maximum number of orders that can be returned per page.
     *     Value must be 1 - 100. Default 100. (optional)
     * @param easyShipShipmentStatuses A list of &#x60;EasyShipShipmentStatus&#x60; values. Used to select Easy Ship
     *     orders with statuses that match the specified values. If &#x60;EasyShipShipmentStatus&#x60; is specified,
     *     only Amazon Easy Ship orders are returned. **Possible values:** - &#x60;PendingSchedule&#x60; (The package is
     *     awaiting the schedule for pick-up.) - &#x60;PendingPickUp&#x60; (Amazon has not yet picked up the package
     *     from the seller.) - &#x60;PendingDropOff&#x60; (The seller will deliver the package to the carrier.) -
     *     &#x60;LabelCanceled&#x60; (The seller canceled the pickup.) - &#x60;PickedUp&#x60; (Amazon has picked up the
     *     package from the seller.) - &#x60;DroppedOff&#x60; (The package is delivered to the carrier by the seller.) -
     *     &#x60;AtOriginFC&#x60; (The packaged is at the origin fulfillment center.) - &#x60;AtDestinationFC&#x60; (The
     *     package is at the destination fulfillment center.) - &#x60;Delivered&#x60; (The package has been delivered.)
     *     - &#x60;RejectedByBuyer&#x60; (The package has been rejected by the buyer.) - &#x60;Undeliverable&#x60; (The
     *     package cannot be delivered.) - &#x60;ReturningToSeller&#x60; (The package was not delivered and is being
     *     returned to the seller.) - &#x60;ReturnedToSeller&#x60; (The package was not delivered and was returned to
     *     the seller.) - &#x60;Lost&#x60; (The package is lost.) - &#x60;OutForDelivery&#x60; (The package is out for
     *     delivery.) - &#x60;Damaged&#x60; (The package was damaged by the carrier.) (optional)
     * @param electronicInvoiceStatuses A list of &#x60;ElectronicInvoiceStatus&#x60; values. Used to select orders with
     *     electronic invoice statuses that match the specified values. **Possible values:** - &#x60;NotRequired&#x60;
     *     (Electronic invoice submission is not required for this order.) - &#x60;NotFound&#x60; (The electronic
     *     invoice was not submitted for this order.) - &#x60;Processing&#x60; (The electronic invoice is being
     *     processed for this order.) - &#x60;Errored&#x60; (The last submitted electronic invoice was rejected for this
     *     order.) - &#x60;Accepted&#x60; (The last submitted electronic invoice was submitted and accepted.) (optional)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param amazonOrderIds A list of &#x60;AmazonOrderId&#x60; values. An &#x60;AmazonOrderId&#x60; is an
     *     Amazon-defined order identifier, in 3-7-7 format. (optional)
     * @param actualFulfillmentSupplySourceId The &#x60;sourceId&#x60; of the location from where you want the order
     *     fulfilled. (optional)
     * @param isISPU When true, this order is marked to be picked up from a store rather than delivered. (optional)
     * @param storeChainStoreId The store chain store identifier. Linked to a specific store in a store chain.
     *     (optional)
     * @param earliestDeliveryDateBefore Use this date to select orders with a earliest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param earliestDeliveryDateAfter Use this date to select orders with a earliest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateBefore Use this date to select orders with a latest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateAfter Use this date to select orders with a latest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @return GetOrdersResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public GetOrdersResponse getOrders(
            List<String> marketplaceIds,
            String createdAfter,
            String createdBefore,
            String lastUpdatedAfter,
            String lastUpdatedBefore,
            List<String> orderStatuses,
            List<String> fulfillmentChannels,
            List<String> paymentMethods,
            String buyerEmail,
            String sellerOrderId,
            Integer maxResultsPerPage,
            List<String> easyShipShipmentStatuses,
            List<String> electronicInvoiceStatuses,
            String nextToken,
            List<String> amazonOrderIds,
            String actualFulfillmentSupplySourceId,
            Boolean isISPU,
            String storeChainStoreId,
            String earliestDeliveryDateBefore,
            String earliestDeliveryDateAfter,
            String latestDeliveryDateBefore,
            String latestDeliveryDateAfter)
            throws ApiException, LWAException {
        ApiResponse<GetOrdersResponse> resp = getOrdersWithHttpInfo(
                marketplaceIds,
                createdAfter,
                createdBefore,
                lastUpdatedAfter,
                lastUpdatedBefore,
                orderStatuses,
                fulfillmentChannels,
                paymentMethods,
                buyerEmail,
                sellerOrderId,
                maxResultsPerPage,
                easyShipShipmentStatuses,
                electronicInvoiceStatuses,
                nextToken,
                amazonOrderIds,
                actualFulfillmentSupplySourceId,
                isISPU,
                storeChainStoreId,
                earliestDeliveryDateBefore,
                earliestDeliveryDateAfter,
                latestDeliveryDateBefore,
                latestDeliveryDateAfter,
                null);
        return resp.getData();
    }

    /**
     * Returns orders that are created or updated during the specified time period. If you want to return specific types
     * of orders, you can apply filters to your request. &#x60;NextToken&#x60; doesn&#x27;t affect any filters that you
     * include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate
     * (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The &#x60;x-amzn-RateLimit-Limit&#x60; response
     * header contains the usage plan rate limits for the operation, when available. The preceding table contains the
     * default rate and burst values for this operation. Selling partners whose business demands require higher
     * throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage
     * Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param marketplaceIds A list of &#x60;MarketplaceId&#x60; values. Used to select orders that were placed in the
     *     specified marketplaces. Refer to [Marketplace
     *     IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of
     *     &#x60;marketplaceId&#x60; values. (required)
     * @param createdAfter Use this date to select orders created after (or at) a specified time. Only orders placed
     *     after the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;LastUpdatedAfter&#x60; and &#x60;LastUpdatedBefore&#x60; cannot be set when
     *     &#x60;CreatedAfter&#x60; is set. (optional)
     * @param createdBefore Use this date to select orders created before (or at) a specified time. Only orders placed
     *     before the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;CreatedBefore&#x60; is
     *     optional when &#x60;CreatedAfter&#x60; is set. If specified, &#x60;CreatedBefore&#x60; must be equal to or
     *     after the &#x60;CreatedAfter&#x60; date and at least two minutes before current time. (optional)
     * @param lastUpdatedAfter Use this date to select orders that were last updated after (or at) a specified time. An
     *     update is defined as any change in order status, including the creation of a new order. Includes updates made
     *     by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;CreatedAfter&#x60; or &#x60;CreatedBefore&#x60; cannot be set when &#x60;LastUpdatedAfter&#x60;
     *     is set. (optional)
     * @param lastUpdatedBefore Use this date to select orders that were last updated before (or at) a specified time.
     *     An update is defined as any change in order status, including the creation of a new order. Includes updates
     *     made by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;LastUpdatedBefore&#x60;
     *     is optional when &#x60;LastUpdatedAfter&#x60; is set. But if specified, &#x60;LastUpdatedBefore&#x60; must be
     *     equal to or after the &#x60;LastUpdatedAfter&#x60; date and at least two minutes before current time.
     *     (optional)
     * @param orderStatuses A list of &#x60;OrderStatus&#x60; values used to filter the results. **Possible values:** -
     *     &#x60;PendingAvailability&#x60; (This status is available for pre-orders only. The order has been placed,
     *     payment has not been authorized, and the release date of the item is in the future.) - &#x60;Pending&#x60;
     *     (The order has been placed but payment has not been authorized.) - &#x60;Unshipped&#x60; (Payment has been
     *     authorized and the order is ready for shipment, but no items in the order have been shipped.) -
     *     &#x60;PartiallyShipped&#x60; (One or more, but not all, items in the order have been shipped.) -
     *     &#x60;Shipped&#x60; (All items in the order have been shipped.) - &#x60;InvoiceUnconfirmed&#x60; (All items
     *     in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been
     *     shipped to the buyer.) - &#x60;Canceled&#x60; (The order has been canceled.) - &#x60;Unfulfillable&#x60; (The
     *     order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) (optional)
     * @param fulfillmentChannels A list that indicates how an order was fulfilled. Filters the results by fulfillment
     *     channel. **Possible values**: &#x60;AFN&#x60; (fulfilled by Amazon), &#x60;MFN&#x60; (fulfilled by seller).
     *     (optional)
     * @param paymentMethods A list of payment method values. Use this field to select orders that were paid with the
     *     specified payment methods. **Possible values**: &#x60;COD&#x60; (cash on delivery), &#x60;CVS&#x60;
     *     (convenience store), &#x60;Other&#x60; (Any payment method other than COD or CVS). (optional)
     * @param buyerEmail The email address of a buyer. Used to select orders that contain the specified email address.
     *     (optional)
     * @param sellerOrderId An order identifier that is specified by the seller. Used to select only the orders that
     *     match the order identifier. If &#x60;SellerOrderId&#x60; is specified, then &#x60;FulfillmentChannels&#x60;,
     *     &#x60;OrderStatuses&#x60;, &#x60;PaymentMethod&#x60;, &#x60;LastUpdatedAfter&#x60;, LastUpdatedBefore, and
     *     &#x60;BuyerEmail&#x60; cannot be specified. (optional)
     * @param maxResultsPerPage A number that indicates the maximum number of orders that can be returned per page.
     *     Value must be 1 - 100. Default 100. (optional)
     * @param easyShipShipmentStatuses A list of &#x60;EasyShipShipmentStatus&#x60; values. Used to select Easy Ship
     *     orders with statuses that match the specified values. If &#x60;EasyShipShipmentStatus&#x60; is specified,
     *     only Amazon Easy Ship orders are returned. **Possible values:** - &#x60;PendingSchedule&#x60; (The package is
     *     awaiting the schedule for pick-up.) - &#x60;PendingPickUp&#x60; (Amazon has not yet picked up the package
     *     from the seller.) - &#x60;PendingDropOff&#x60; (The seller will deliver the package to the carrier.) -
     *     &#x60;LabelCanceled&#x60; (The seller canceled the pickup.) - &#x60;PickedUp&#x60; (Amazon has picked up the
     *     package from the seller.) - &#x60;DroppedOff&#x60; (The package is delivered to the carrier by the seller.) -
     *     &#x60;AtOriginFC&#x60; (The packaged is at the origin fulfillment center.) - &#x60;AtDestinationFC&#x60; (The
     *     package is at the destination fulfillment center.) - &#x60;Delivered&#x60; (The package has been delivered.)
     *     - &#x60;RejectedByBuyer&#x60; (The package has been rejected by the buyer.) - &#x60;Undeliverable&#x60; (The
     *     package cannot be delivered.) - &#x60;ReturningToSeller&#x60; (The package was not delivered and is being
     *     returned to the seller.) - &#x60;ReturnedToSeller&#x60; (The package was not delivered and was returned to
     *     the seller.) - &#x60;Lost&#x60; (The package is lost.) - &#x60;OutForDelivery&#x60; (The package is out for
     *     delivery.) - &#x60;Damaged&#x60; (The package was damaged by the carrier.) (optional)
     * @param electronicInvoiceStatuses A list of &#x60;ElectronicInvoiceStatus&#x60; values. Used to select orders with
     *     electronic invoice statuses that match the specified values. **Possible values:** - &#x60;NotRequired&#x60;
     *     (Electronic invoice submission is not required for this order.) - &#x60;NotFound&#x60; (The electronic
     *     invoice was not submitted for this order.) - &#x60;Processing&#x60; (The electronic invoice is being
     *     processed for this order.) - &#x60;Errored&#x60; (The last submitted electronic invoice was rejected for this
     *     order.) - &#x60;Accepted&#x60; (The last submitted electronic invoice was submitted and accepted.) (optional)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param amazonOrderIds A list of &#x60;AmazonOrderId&#x60; values. An &#x60;AmazonOrderId&#x60; is an
     *     Amazon-defined order identifier, in 3-7-7 format. (optional)
     * @param actualFulfillmentSupplySourceId The &#x60;sourceId&#x60; of the location from where you want the order
     *     fulfilled. (optional)
     * @param isISPU When true, this order is marked to be picked up from a store rather than delivered. (optional)
     * @param storeChainStoreId The store chain store identifier. Linked to a specific store in a store chain.
     *     (optional)
     * @param earliestDeliveryDateBefore Use this date to select orders with a earliest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param earliestDeliveryDateAfter Use this date to select orders with a earliest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateBefore Use this date to select orders with a latest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateAfter Use this date to select orders with a latest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;GetOrdersResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrdersResponse> getOrdersWithHttpInfo(
            List<String> marketplaceIds,
            String createdAfter,
            String createdBefore,
            String lastUpdatedAfter,
            String lastUpdatedBefore,
            List<String> orderStatuses,
            List<String> fulfillmentChannels,
            List<String> paymentMethods,
            String buyerEmail,
            String sellerOrderId,
            Integer maxResultsPerPage,
            List<String> easyShipShipmentStatuses,
            List<String> electronicInvoiceStatuses,
            String nextToken,
            List<String> amazonOrderIds,
            String actualFulfillmentSupplySourceId,
            Boolean isISPU,
            String storeChainStoreId,
            String earliestDeliveryDateBefore,
            String earliestDeliveryDateAfter,
            String latestDeliveryDateBefore,
            String latestDeliveryDateAfter,
            String restrictedDataToken)
            throws ApiException, LWAException {
        okhttp3.Call call = getOrdersValidateBeforeCall(
                marketplaceIds,
                createdAfter,
                createdBefore,
                lastUpdatedAfter,
                lastUpdatedBefore,
                orderStatuses,
                fulfillmentChannels,
                paymentMethods,
                buyerEmail,
                sellerOrderId,
                maxResultsPerPage,
                easyShipShipmentStatuses,
                electronicInvoiceStatuses,
                nextToken,
                amazonOrderIds,
                actualFulfillmentSupplySourceId,
                isISPU,
                storeChainStoreId,
                earliestDeliveryDateBefore,
                earliestDeliveryDateAfter,
                latestDeliveryDateBefore,
                latestDeliveryDateAfter,
                null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrders");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrdersBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrdersResponse>() {}.getType();
            return apiClient.execute(call, localVarReturnType);
        } else throw new ApiException.RateLimitExceeded("getOrders operation exceeds rate limit");
    }

    /**
     * Returns orders that are created or updated during the specified time period. If you want to return specific types
     * of orders, you can apply filters to your request. &#x60;NextToken&#x60; doesn&#x27;t affect any filters that you
     * include in your request; it only impacts the pagination for the filtered orders response. **Usage Plan:** | Rate
     * (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The &#x60;x-amzn-RateLimit-Limit&#x60; response
     * header contains the usage plan rate limits for the operation, when available. The preceding table contains the
     * default rate and burst values for this operation. Selling partners whose business demands require higher
     * throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage
     * Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param marketplaceIds A list of &#x60;MarketplaceId&#x60; values. Used to select orders that were placed in the
     *     specified marketplaces. Refer to [Marketplace
     *     IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of
     *     &#x60;marketplaceId&#x60; values. (required)
     * @param createdAfter Use this date to select orders created after (or at) a specified time. Only orders placed
     *     after the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;LastUpdatedAfter&#x60; and &#x60;LastUpdatedBefore&#x60; cannot be set when
     *     &#x60;CreatedAfter&#x60; is set. (optional)
     * @param createdBefore Use this date to select orders created before (or at) a specified time. Only orders placed
     *     before the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;CreatedBefore&#x60; is
     *     optional when &#x60;CreatedAfter&#x60; is set. If specified, &#x60;CreatedBefore&#x60; must be equal to or
     *     after the &#x60;CreatedAfter&#x60; date and at least two minutes before current time. (optional)
     * @param lastUpdatedAfter Use this date to select orders that were last updated after (or at) a specified time. An
     *     update is defined as any change in order status, including the creation of a new order. Includes updates made
     *     by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;CreatedAfter&#x60; or &#x60;CreatedBefore&#x60; cannot be set when &#x60;LastUpdatedAfter&#x60;
     *     is set. (optional)
     * @param lastUpdatedBefore Use this date to select orders that were last updated before (or at) a specified time.
     *     An update is defined as any change in order status, including the creation of a new order. Includes updates
     *     made by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;LastUpdatedBefore&#x60;
     *     is optional when &#x60;LastUpdatedAfter&#x60; is set. But if specified, &#x60;LastUpdatedBefore&#x60; must be
     *     equal to or after the &#x60;LastUpdatedAfter&#x60; date and at least two minutes before current time.
     *     (optional)
     * @param orderStatuses A list of &#x60;OrderStatus&#x60; values used to filter the results. **Possible values:** -
     *     &#x60;PendingAvailability&#x60; (This status is available for pre-orders only. The order has been placed,
     *     payment has not been authorized, and the release date of the item is in the future.) - &#x60;Pending&#x60;
     *     (The order has been placed but payment has not been authorized.) - &#x60;Unshipped&#x60; (Payment has been
     *     authorized and the order is ready for shipment, but no items in the order have been shipped.) -
     *     &#x60;PartiallyShipped&#x60; (One or more, but not all, items in the order have been shipped.) -
     *     &#x60;Shipped&#x60; (All items in the order have been shipped.) - &#x60;InvoiceUnconfirmed&#x60; (All items
     *     in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been
     *     shipped to the buyer.) - &#x60;Canceled&#x60; (The order has been canceled.) - &#x60;Unfulfillable&#x60; (The
     *     order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) (optional)
     * @param fulfillmentChannels A list that indicates how an order was fulfilled. Filters the results by fulfillment
     *     channel. **Possible values**: &#x60;AFN&#x60; (fulfilled by Amazon), &#x60;MFN&#x60; (fulfilled by seller).
     *     (optional)
     * @param paymentMethods A list of payment method values. Use this field to select orders that were paid with the
     *     specified payment methods. **Possible values**: &#x60;COD&#x60; (cash on delivery), &#x60;CVS&#x60;
     *     (convenience store), &#x60;Other&#x60; (Any payment method other than COD or CVS). (optional)
     * @param buyerEmail The email address of a buyer. Used to select orders that contain the specified email address.
     *     (optional)
     * @param sellerOrderId An order identifier that is specified by the seller. Used to select only the orders that
     *     match the order identifier. If &#x60;SellerOrderId&#x60; is specified, then &#x60;FulfillmentChannels&#x60;,
     *     &#x60;OrderStatuses&#x60;, &#x60;PaymentMethod&#x60;, &#x60;LastUpdatedAfter&#x60;, LastUpdatedBefore, and
     *     &#x60;BuyerEmail&#x60; cannot be specified. (optional)
     * @param maxResultsPerPage A number that indicates the maximum number of orders that can be returned per page.
     *     Value must be 1 - 100. Default 100. (optional)
     * @param easyShipShipmentStatuses A list of &#x60;EasyShipShipmentStatus&#x60; values. Used to select Easy Ship
     *     orders with statuses that match the specified values. If &#x60;EasyShipShipmentStatus&#x60; is specified,
     *     only Amazon Easy Ship orders are returned. **Possible values:** - &#x60;PendingSchedule&#x60; (The package is
     *     awaiting the schedule for pick-up.) - &#x60;PendingPickUp&#x60; (Amazon has not yet picked up the package
     *     from the seller.) - &#x60;PendingDropOff&#x60; (The seller will deliver the package to the carrier.) -
     *     &#x60;LabelCanceled&#x60; (The seller canceled the pickup.) - &#x60;PickedUp&#x60; (Amazon has picked up the
     *     package from the seller.) - &#x60;DroppedOff&#x60; (The package is delivered to the carrier by the seller.) -
     *     &#x60;AtOriginFC&#x60; (The packaged is at the origin fulfillment center.) - &#x60;AtDestinationFC&#x60; (The
     *     package is at the destination fulfillment center.) - &#x60;Delivered&#x60; (The package has been delivered.)
     *     - &#x60;RejectedByBuyer&#x60; (The package has been rejected by the buyer.) - &#x60;Undeliverable&#x60; (The
     *     package cannot be delivered.) - &#x60;ReturningToSeller&#x60; (The package was not delivered and is being
     *     returned to the seller.) - &#x60;ReturnedToSeller&#x60; (The package was not delivered and was returned to
     *     the seller.) - &#x60;Lost&#x60; (The package is lost.) - &#x60;OutForDelivery&#x60; (The package is out for
     *     delivery.) - &#x60;Damaged&#x60; (The package was damaged by the carrier.) (optional)
     * @param electronicInvoiceStatuses A list of &#x60;ElectronicInvoiceStatus&#x60; values. Used to select orders with
     *     electronic invoice statuses that match the specified values. **Possible values:** - &#x60;NotRequired&#x60;
     *     (Electronic invoice submission is not required for this order.) - &#x60;NotFound&#x60; (The electronic
     *     invoice was not submitted for this order.) - &#x60;Processing&#x60; (The electronic invoice is being
     *     processed for this order.) - &#x60;Errored&#x60; (The last submitted electronic invoice was rejected for this
     *     order.) - &#x60;Accepted&#x60; (The last submitted electronic invoice was submitted and accepted.) (optional)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param amazonOrderIds A list of &#x60;AmazonOrderId&#x60; values. An &#x60;AmazonOrderId&#x60; is an
     *     Amazon-defined order identifier, in 3-7-7 format. (optional)
     * @param actualFulfillmentSupplySourceId The &#x60;sourceId&#x60; of the location from where you want the order
     *     fulfilled. (optional)
     * @param isISPU When true, this order is marked to be picked up from a store rather than delivered. (optional)
     * @param storeChainStoreId The store chain store identifier. Linked to a specific store in a store chain.
     *     (optional)
     * @param earliestDeliveryDateBefore Use this date to select orders with a earliest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param earliestDeliveryDateAfter Use this date to select orders with a earliest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateBefore Use this date to select orders with a latest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateAfter Use this date to select orders with a latest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @return ApiResponse&lt;GetOrdersResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<GetOrdersResponse> getOrdersWithHttpInfo(
            List<String> marketplaceIds,
            String createdAfter,
            String createdBefore,
            String lastUpdatedAfter,
            String lastUpdatedBefore,
            List<String> orderStatuses,
            List<String> fulfillmentChannels,
            List<String> paymentMethods,
            String buyerEmail,
            String sellerOrderId,
            Integer maxResultsPerPage,
            List<String> easyShipShipmentStatuses,
            List<String> electronicInvoiceStatuses,
            String nextToken,
            List<String> amazonOrderIds,
            String actualFulfillmentSupplySourceId,
            Boolean isISPU,
            String storeChainStoreId,
            String earliestDeliveryDateBefore,
            String earliestDeliveryDateAfter,
            String latestDeliveryDateBefore,
            String latestDeliveryDateAfter)
            throws ApiException, LWAException {
        return getOrdersWithHttpInfo(
                marketplaceIds,
                createdAfter,
                createdBefore,
                lastUpdatedAfter,
                lastUpdatedBefore,
                orderStatuses,
                fulfillmentChannels,
                paymentMethods,
                buyerEmail,
                sellerOrderId,
                maxResultsPerPage,
                easyShipShipmentStatuses,
                electronicInvoiceStatuses,
                nextToken,
                amazonOrderIds,
                actualFulfillmentSupplySourceId,
                isISPU,
                storeChainStoreId,
                earliestDeliveryDateBefore,
                earliestDeliveryDateAfter,
                latestDeliveryDateBefore,
                latestDeliveryDateAfter,
                null);
    }

    /**
     * (asynchronously) Returns orders that are created or updated during the specified time period. If you want to
     * return specific types of orders, you can apply filters to your request. &#x60;NextToken&#x60; doesn&#x27;t affect
     * any filters that you include in your request; it only impacts the pagination for the filtered orders response.
     * **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The
     * &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate limits for the operation, when
     * available. The preceding table contains the default rate and burst values for this operation. Selling partners
     * whose business demands require higher throughput might have higher rate and burst values than those shown here.
     * For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param marketplaceIds A list of &#x60;MarketplaceId&#x60; values. Used to select orders that were placed in the
     *     specified marketplaces. Refer to [Marketplace
     *     IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of
     *     &#x60;marketplaceId&#x60; values. (required)
     * @param createdAfter Use this date to select orders created after (or at) a specified time. Only orders placed
     *     after the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;LastUpdatedAfter&#x60; and &#x60;LastUpdatedBefore&#x60; cannot be set when
     *     &#x60;CreatedAfter&#x60; is set. (optional)
     * @param createdBefore Use this date to select orders created before (or at) a specified time. Only orders placed
     *     before the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;CreatedBefore&#x60; is
     *     optional when &#x60;CreatedAfter&#x60; is set. If specified, &#x60;CreatedBefore&#x60; must be equal to or
     *     after the &#x60;CreatedAfter&#x60; date and at least two minutes before current time. (optional)
     * @param lastUpdatedAfter Use this date to select orders that were last updated after (or at) a specified time. An
     *     update is defined as any change in order status, including the creation of a new order. Includes updates made
     *     by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;CreatedAfter&#x60; or &#x60;CreatedBefore&#x60; cannot be set when &#x60;LastUpdatedAfter&#x60;
     *     is set. (optional)
     * @param lastUpdatedBefore Use this date to select orders that were last updated before (or at) a specified time.
     *     An update is defined as any change in order status, including the creation of a new order. Includes updates
     *     made by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;LastUpdatedBefore&#x60;
     *     is optional when &#x60;LastUpdatedAfter&#x60; is set. But if specified, &#x60;LastUpdatedBefore&#x60; must be
     *     equal to or after the &#x60;LastUpdatedAfter&#x60; date and at least two minutes before current time.
     *     (optional)
     * @param orderStatuses A list of &#x60;OrderStatus&#x60; values used to filter the results. **Possible values:** -
     *     &#x60;PendingAvailability&#x60; (This status is available for pre-orders only. The order has been placed,
     *     payment has not been authorized, and the release date of the item is in the future.) - &#x60;Pending&#x60;
     *     (The order has been placed but payment has not been authorized.) - &#x60;Unshipped&#x60; (Payment has been
     *     authorized and the order is ready for shipment, but no items in the order have been shipped.) -
     *     &#x60;PartiallyShipped&#x60; (One or more, but not all, items in the order have been shipped.) -
     *     &#x60;Shipped&#x60; (All items in the order have been shipped.) - &#x60;InvoiceUnconfirmed&#x60; (All items
     *     in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been
     *     shipped to the buyer.) - &#x60;Canceled&#x60; (The order has been canceled.) - &#x60;Unfulfillable&#x60; (The
     *     order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) (optional)
     * @param fulfillmentChannels A list that indicates how an order was fulfilled. Filters the results by fulfillment
     *     channel. **Possible values**: &#x60;AFN&#x60; (fulfilled by Amazon), &#x60;MFN&#x60; (fulfilled by seller).
     *     (optional)
     * @param paymentMethods A list of payment method values. Use this field to select orders that were paid with the
     *     specified payment methods. **Possible values**: &#x60;COD&#x60; (cash on delivery), &#x60;CVS&#x60;
     *     (convenience store), &#x60;Other&#x60; (Any payment method other than COD or CVS). (optional)
     * @param buyerEmail The email address of a buyer. Used to select orders that contain the specified email address.
     *     (optional)
     * @param sellerOrderId An order identifier that is specified by the seller. Used to select only the orders that
     *     match the order identifier. If &#x60;SellerOrderId&#x60; is specified, then &#x60;FulfillmentChannels&#x60;,
     *     &#x60;OrderStatuses&#x60;, &#x60;PaymentMethod&#x60;, &#x60;LastUpdatedAfter&#x60;, LastUpdatedBefore, and
     *     &#x60;BuyerEmail&#x60; cannot be specified. (optional)
     * @param maxResultsPerPage A number that indicates the maximum number of orders that can be returned per page.
     *     Value must be 1 - 100. Default 100. (optional)
     * @param easyShipShipmentStatuses A list of &#x60;EasyShipShipmentStatus&#x60; values. Used to select Easy Ship
     *     orders with statuses that match the specified values. If &#x60;EasyShipShipmentStatus&#x60; is specified,
     *     only Amazon Easy Ship orders are returned. **Possible values:** - &#x60;PendingSchedule&#x60; (The package is
     *     awaiting the schedule for pick-up.) - &#x60;PendingPickUp&#x60; (Amazon has not yet picked up the package
     *     from the seller.) - &#x60;PendingDropOff&#x60; (The seller will deliver the package to the carrier.) -
     *     &#x60;LabelCanceled&#x60; (The seller canceled the pickup.) - &#x60;PickedUp&#x60; (Amazon has picked up the
     *     package from the seller.) - &#x60;DroppedOff&#x60; (The package is delivered to the carrier by the seller.) -
     *     &#x60;AtOriginFC&#x60; (The packaged is at the origin fulfillment center.) - &#x60;AtDestinationFC&#x60; (The
     *     package is at the destination fulfillment center.) - &#x60;Delivered&#x60; (The package has been delivered.)
     *     - &#x60;RejectedByBuyer&#x60; (The package has been rejected by the buyer.) - &#x60;Undeliverable&#x60; (The
     *     package cannot be delivered.) - &#x60;ReturningToSeller&#x60; (The package was not delivered and is being
     *     returned to the seller.) - &#x60;ReturnedToSeller&#x60; (The package was not delivered and was returned to
     *     the seller.) - &#x60;Lost&#x60; (The package is lost.) - &#x60;OutForDelivery&#x60; (The package is out for
     *     delivery.) - &#x60;Damaged&#x60; (The package was damaged by the carrier.) (optional)
     * @param electronicInvoiceStatuses A list of &#x60;ElectronicInvoiceStatus&#x60; values. Used to select orders with
     *     electronic invoice statuses that match the specified values. **Possible values:** - &#x60;NotRequired&#x60;
     *     (Electronic invoice submission is not required for this order.) - &#x60;NotFound&#x60; (The electronic
     *     invoice was not submitted for this order.) - &#x60;Processing&#x60; (The electronic invoice is being
     *     processed for this order.) - &#x60;Errored&#x60; (The last submitted electronic invoice was rejected for this
     *     order.) - &#x60;Accepted&#x60; (The last submitted electronic invoice was submitted and accepted.) (optional)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param amazonOrderIds A list of &#x60;AmazonOrderId&#x60; values. An &#x60;AmazonOrderId&#x60; is an
     *     Amazon-defined order identifier, in 3-7-7 format. (optional)
     * @param actualFulfillmentSupplySourceId The &#x60;sourceId&#x60; of the location from where you want the order
     *     fulfilled. (optional)
     * @param isISPU When true, this order is marked to be picked up from a store rather than delivered. (optional)
     * @param storeChainStoreId The store chain store identifier. Linked to a specific store in a store chain.
     *     (optional)
     * @param earliestDeliveryDateBefore Use this date to select orders with a earliest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param earliestDeliveryDateAfter Use this date to select orders with a earliest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateBefore Use this date to select orders with a latest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateAfter Use this date to select orders with a latest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrdersAsync(
            List<String> marketplaceIds,
            String createdAfter,
            String createdBefore,
            String lastUpdatedAfter,
            String lastUpdatedBefore,
            List<String> orderStatuses,
            List<String> fulfillmentChannels,
            List<String> paymentMethods,
            String buyerEmail,
            String sellerOrderId,
            Integer maxResultsPerPage,
            List<String> easyShipShipmentStatuses,
            List<String> electronicInvoiceStatuses,
            String nextToken,
            List<String> amazonOrderIds,
            String actualFulfillmentSupplySourceId,
            Boolean isISPU,
            String storeChainStoreId,
            String earliestDeliveryDateBefore,
            String earliestDeliveryDateAfter,
            String latestDeliveryDateBefore,
            String latestDeliveryDateAfter,
            final ApiCallback<GetOrdersResponse> callback)
            throws ApiException, LWAException {
        return getOrdersAsync(
                marketplaceIds,
                createdAfter,
                createdBefore,
                lastUpdatedAfter,
                lastUpdatedBefore,
                orderStatuses,
                fulfillmentChannels,
                paymentMethods,
                buyerEmail,
                sellerOrderId,
                maxResultsPerPage,
                easyShipShipmentStatuses,
                electronicInvoiceStatuses,
                nextToken,
                amazonOrderIds,
                actualFulfillmentSupplySourceId,
                isISPU,
                storeChainStoreId,
                earliestDeliveryDateBefore,
                earliestDeliveryDateAfter,
                latestDeliveryDateBefore,
                latestDeliveryDateAfter,
                callback,
                null);
    }
    /**
     * (asynchronously) Returns orders that are created or updated during the specified time period. If you want to
     * return specific types of orders, you can apply filters to your request. &#x60;NextToken&#x60; doesn&#x27;t affect
     * any filters that you include in your request; it only impacts the pagination for the filtered orders response.
     * **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 20 | The
     * &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate limits for the operation, when
     * available. The preceding table contains the default rate and burst values for this operation. Selling partners
     * whose business demands require higher throughput might have higher rate and burst values than those shown here.
     * For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param marketplaceIds A list of &#x60;MarketplaceId&#x60; values. Used to select orders that were placed in the
     *     specified marketplaces. Refer to [Marketplace
     *     IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of
     *     &#x60;marketplaceId&#x60; values. (required)
     * @param createdAfter Use this date to select orders created after (or at) a specified time. Only orders placed
     *     after the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;LastUpdatedAfter&#x60; and &#x60;LastUpdatedBefore&#x60; cannot be set when
     *     &#x60;CreatedAfter&#x60; is set. (optional)
     * @param createdBefore Use this date to select orders created before (or at) a specified time. Only orders placed
     *     before the specified time are returned. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;CreatedBefore&#x60; is
     *     optional when &#x60;CreatedAfter&#x60; is set. If specified, &#x60;CreatedBefore&#x60; must be equal to or
     *     after the &#x60;CreatedAfter&#x60; date and at least two minutes before current time. (optional)
     * @param lastUpdatedAfter Use this date to select orders that were last updated after (or at) a specified time. An
     *     update is defined as any change in order status, including the creation of a new order. Includes updates made
     *     by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: Either the
     *     &#x60;CreatedAfter&#x60; parameter or the &#x60;LastUpdatedAfter&#x60; parameter is required. Both cannot be
     *     empty. &#x60;CreatedAfter&#x60; or &#x60;CreatedBefore&#x60; cannot be set when &#x60;LastUpdatedAfter&#x60;
     *     is set. (optional)
     * @param lastUpdatedBefore Use this date to select orders that were last updated before (or at) a specified time.
     *     An update is defined as any change in order status, including the creation of a new order. Includes updates
     *     made by Amazon and by the seller. The date must be in [ISO
     *     8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: &#x60;LastUpdatedBefore&#x60;
     *     is optional when &#x60;LastUpdatedAfter&#x60; is set. But if specified, &#x60;LastUpdatedBefore&#x60; must be
     *     equal to or after the &#x60;LastUpdatedAfter&#x60; date and at least two minutes before current time.
     *     (optional)
     * @param orderStatuses A list of &#x60;OrderStatus&#x60; values used to filter the results. **Possible values:** -
     *     &#x60;PendingAvailability&#x60; (This status is available for pre-orders only. The order has been placed,
     *     payment has not been authorized, and the release date of the item is in the future.) - &#x60;Pending&#x60;
     *     (The order has been placed but payment has not been authorized.) - &#x60;Unshipped&#x60; (Payment has been
     *     authorized and the order is ready for shipment, but no items in the order have been shipped.) -
     *     &#x60;PartiallyShipped&#x60; (One or more, but not all, items in the order have been shipped.) -
     *     &#x60;Shipped&#x60; (All items in the order have been shipped.) - &#x60;InvoiceUnconfirmed&#x60; (All items
     *     in the order have been shipped. The seller has not yet given confirmation to Amazon that the invoice has been
     *     shipped to the buyer.) - &#x60;Canceled&#x60; (The order has been canceled.) - &#x60;Unfulfillable&#x60; (The
     *     order cannot be fulfilled. This state applies only to Multi-Channel Fulfillment orders.) (optional)
     * @param fulfillmentChannels A list that indicates how an order was fulfilled. Filters the results by fulfillment
     *     channel. **Possible values**: &#x60;AFN&#x60; (fulfilled by Amazon), &#x60;MFN&#x60; (fulfilled by seller).
     *     (optional)
     * @param paymentMethods A list of payment method values. Use this field to select orders that were paid with the
     *     specified payment methods. **Possible values**: &#x60;COD&#x60; (cash on delivery), &#x60;CVS&#x60;
     *     (convenience store), &#x60;Other&#x60; (Any payment method other than COD or CVS). (optional)
     * @param buyerEmail The email address of a buyer. Used to select orders that contain the specified email address.
     *     (optional)
     * @param sellerOrderId An order identifier that is specified by the seller. Used to select only the orders that
     *     match the order identifier. If &#x60;SellerOrderId&#x60; is specified, then &#x60;FulfillmentChannels&#x60;,
     *     &#x60;OrderStatuses&#x60;, &#x60;PaymentMethod&#x60;, &#x60;LastUpdatedAfter&#x60;, LastUpdatedBefore, and
     *     &#x60;BuyerEmail&#x60; cannot be specified. (optional)
     * @param maxResultsPerPage A number that indicates the maximum number of orders that can be returned per page.
     *     Value must be 1 - 100. Default 100. (optional)
     * @param easyShipShipmentStatuses A list of &#x60;EasyShipShipmentStatus&#x60; values. Used to select Easy Ship
     *     orders with statuses that match the specified values. If &#x60;EasyShipShipmentStatus&#x60; is specified,
     *     only Amazon Easy Ship orders are returned. **Possible values:** - &#x60;PendingSchedule&#x60; (The package is
     *     awaiting the schedule for pick-up.) - &#x60;PendingPickUp&#x60; (Amazon has not yet picked up the package
     *     from the seller.) - &#x60;PendingDropOff&#x60; (The seller will deliver the package to the carrier.) -
     *     &#x60;LabelCanceled&#x60; (The seller canceled the pickup.) - &#x60;PickedUp&#x60; (Amazon has picked up the
     *     package from the seller.) - &#x60;DroppedOff&#x60; (The package is delivered to the carrier by the seller.) -
     *     &#x60;AtOriginFC&#x60; (The packaged is at the origin fulfillment center.) - &#x60;AtDestinationFC&#x60; (The
     *     package is at the destination fulfillment center.) - &#x60;Delivered&#x60; (The package has been delivered.)
     *     - &#x60;RejectedByBuyer&#x60; (The package has been rejected by the buyer.) - &#x60;Undeliverable&#x60; (The
     *     package cannot be delivered.) - &#x60;ReturningToSeller&#x60; (The package was not delivered and is being
     *     returned to the seller.) - &#x60;ReturnedToSeller&#x60; (The package was not delivered and was returned to
     *     the seller.) - &#x60;Lost&#x60; (The package is lost.) - &#x60;OutForDelivery&#x60; (The package is out for
     *     delivery.) - &#x60;Damaged&#x60; (The package was damaged by the carrier.) (optional)
     * @param electronicInvoiceStatuses A list of &#x60;ElectronicInvoiceStatus&#x60; values. Used to select orders with
     *     electronic invoice statuses that match the specified values. **Possible values:** - &#x60;NotRequired&#x60;
     *     (Electronic invoice submission is not required for this order.) - &#x60;NotFound&#x60; (The electronic
     *     invoice was not submitted for this order.) - &#x60;Processing&#x60; (The electronic invoice is being
     *     processed for this order.) - &#x60;Errored&#x60; (The last submitted electronic invoice was rejected for this
     *     order.) - &#x60;Accepted&#x60; (The last submitted electronic invoice was submitted and accepted.) (optional)
     * @param nextToken A string token returned in the response of your previous request. (optional)
     * @param amazonOrderIds A list of &#x60;AmazonOrderId&#x60; values. An &#x60;AmazonOrderId&#x60; is an
     *     Amazon-defined order identifier, in 3-7-7 format. (optional)
     * @param actualFulfillmentSupplySourceId The &#x60;sourceId&#x60; of the location from where you want the order
     *     fulfilled. (optional)
     * @param isISPU When true, this order is marked to be picked up from a store rather than delivered. (optional)
     * @param storeChainStoreId The store chain store identifier. Linked to a specific store in a store chain.
     *     (optional)
     * @param earliestDeliveryDateBefore Use this date to select orders with a earliest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param earliestDeliveryDateAfter Use this date to select orders with a earliest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateBefore Use this date to select orders with a latest delivery date before (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param latestDeliveryDateAfter Use this date to select orders with a latest delivery date after (or at) a
     *     specified time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
     *     format. (optional)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call getOrdersAsync(
            List<String> marketplaceIds,
            String createdAfter,
            String createdBefore,
            String lastUpdatedAfter,
            String lastUpdatedBefore,
            List<String> orderStatuses,
            List<String> fulfillmentChannels,
            List<String> paymentMethods,
            String buyerEmail,
            String sellerOrderId,
            Integer maxResultsPerPage,
            List<String> easyShipShipmentStatuses,
            List<String> electronicInvoiceStatuses,
            String nextToken,
            List<String> amazonOrderIds,
            String actualFulfillmentSupplySourceId,
            Boolean isISPU,
            String storeChainStoreId,
            String earliestDeliveryDateBefore,
            String earliestDeliveryDateAfter,
            String latestDeliveryDateBefore,
            String latestDeliveryDateAfter,
            final ApiCallback<GetOrdersResponse> callback,
            String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = getOrdersValidateBeforeCall(
                marketplaceIds,
                createdAfter,
                createdBefore,
                lastUpdatedAfter,
                lastUpdatedBefore,
                orderStatuses,
                fulfillmentChannels,
                paymentMethods,
                buyerEmail,
                sellerOrderId,
                maxResultsPerPage,
                easyShipShipmentStatuses,
                electronicInvoiceStatuses,
                nextToken,
                amazonOrderIds,
                actualFulfillmentSupplySourceId,
                isISPU,
                storeChainStoreId,
                earliestDeliveryDateBefore,
                earliestDeliveryDateAfter,
                latestDeliveryDateBefore,
                latestDeliveryDateAfter,
                progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(request, restrictedDataToken, "OrdersV0Api-getOrders");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || getOrdersBucket.tryConsume(1)) {
            Type localVarReturnType = new TypeToken<GetOrdersResponse>() {}.getType();
            apiClient.executeAsync(call, localVarReturnType, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("getOrders operation exceeds rate limit");
    }
    /**
     * Build call for updateVerificationStatus
     *
     * @param body The request body for the &#x60;updateVerificationStatus&#x60; operation. (required)
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    private okhttp3.Call updateVerificationStatusCall(
            UpdateVerificationStatusRequest body,
            String orderId,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/orders/v0/orders/{orderId}/regulatedInfo"
                .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {"application/json"};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {"application/json"};
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        return apiClient.buildCall(
                localVarPath,
                "PATCH",
                localVarQueryParams,
                localVarCollectionQueryParams,
                localVarPostBody,
                localVarHeaderParams,
                localVarFormParams,
                progressRequestListener);
    }

    private okhttp3.Call updateVerificationStatusValidateBeforeCall(
            UpdateVerificationStatusRequest body,
            String orderId,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener)
            throws ApiException, LWAException {
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException(
                    "Missing the required parameter 'body' when calling updateVerificationStatus(Async)");
        }
        // verify the required parameter 'orderId' is set
        if (orderId == null) {
            throw new ApiException(
                    "Missing the required parameter 'orderId' when calling updateVerificationStatus(Async)");
        }

        return updateVerificationStatusCall(body, orderId, progressRequestListener);
    }

    /**
     * Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:**
     * | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60;
     * response header contains the usage plan rate limits for the operation, when available. The preceding table
     * contains the default rate and burst values for this operation. Selling partners whose business demands require
     * higher throughput might have higher rate and burst values than those shown here. For more information, refer to
     * [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body The request body for the &#x60;updateVerificationStatus&#x60; operation. (required)
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public void updateVerificationStatus(
            UpdateVerificationStatusRequest body, String orderId, String restrictedDataToken)
            throws ApiException, LWAException {
        updateVerificationStatusWithHttpInfo(body, orderId, restrictedDataToken);
    }

    /**
     * Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:**
     * | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60;
     * response header contains the usage plan rate limits for the operation, when available. The preceding table
     * contains the default rate and burst values for this operation. Selling partners whose business demands require
     * higher throughput might have higher rate and burst values than those shown here. For more information, refer to
     * [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body The request body for the &#x60;updateVerificationStatus&#x60; operation. (required)
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public void updateVerificationStatus(UpdateVerificationStatusRequest body, String orderId)
            throws ApiException, LWAException {
        updateVerificationStatusWithHttpInfo(body, orderId, null);
    }

    /**
     * Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:**
     * | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60;
     * response header contains the usage plan rate limits for the operation, when available. The preceding table
     * contains the default rate and burst values for this operation. Selling partners whose business demands require
     * higher throughput might have higher rate and burst values than those shown here. For more information, refer to
     * [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body The request body for the &#x60;updateVerificationStatus&#x60; operation. (required)
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<Void> updateVerificationStatusWithHttpInfo(
            UpdateVerificationStatusRequest body, String orderId, String restrictedDataToken)
            throws ApiException, LWAException {
        okhttp3.Call call = updateVerificationStatusValidateBeforeCall(body, orderId, null);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(
                    request, restrictedDataToken, "OrdersV0Api-updateVerificationStatus");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || updateVerificationStatusBucket.tryConsume(1)) {
            return apiClient.execute(call);
        } else throw new ApiException.RateLimitExceeded("updateVerificationStatus operation exceeds rate limit");
    }

    /**
     * Updates (approves or rejects) the verification status of an order containing regulated products. **Usage Plan:**
     * | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The &#x60;x-amzn-RateLimit-Limit&#x60;
     * response header contains the usage plan rate limits for the operation, when available. The preceding table
     * contains the default rate and burst values for this operation. Selling partners whose business demands require
     * higher throughput might have higher rate and burst values than those shown here. For more information, refer to
     * [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body The request body for the &#x60;updateVerificationStatus&#x60; operation. (required)
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public ApiResponse<Void> updateVerificationStatusWithHttpInfo(UpdateVerificationStatusRequest body, String orderId)
            throws ApiException, LWAException {
        return updateVerificationStatusWithHttpInfo(body, orderId, null);
    }

    /**
     * (asynchronously) Updates (approves or rejects) the verification status of an order containing regulated products.
     * **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The
     * &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate limits for the operation, when
     * available. The preceding table contains the default rate and burst values for this operation. Selling partners
     * whose business demands require higher throughput might have higher rate and burst values than those shown here.
     * For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body The request body for the &#x60;updateVerificationStatus&#x60; operation. (required)
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call updateVerificationStatusAsync(
            UpdateVerificationStatusRequest body, String orderId, final ApiCallback<Void> callback)
            throws ApiException, LWAException {
        return updateVerificationStatusAsync(body, orderId, callback, null);
    }
    /**
     * (asynchronously) Updates (approves or rejects) the verification status of an order containing regulated products.
     * **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | The
     * &#x60;x-amzn-RateLimit-Limit&#x60; response header contains the usage plan rate limits for the operation, when
     * available. The preceding table contains the default rate and burst values for this operation. Selling partners
     * whose business demands require higher throughput might have higher rate and burst values than those shown here.
     * For more information, refer to [Usage Plans and Rate
     * Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
     *
     * @param body The request body for the &#x60;updateVerificationStatus&#x60; operation. (required)
     * @param orderId The Amazon order identifier in 3-7-7 format. (required)
     * @param callback The callback to be executed when the API call finishes
     * @param restrictedDataToken Restricted Data Token (optional)
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @throws LWAException If calls to fetch LWA access token fails
     */
    public okhttp3.Call updateVerificationStatusAsync(
            UpdateVerificationStatusRequest body,
            String orderId,
            final ApiCallback<Void> callback,
            String restrictedDataToken)
            throws ApiException, LWAException {

        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressRequestListener = callback::onUploadProgress;
        }

        okhttp3.Call call = updateVerificationStatusValidateBeforeCall(body, orderId, progressRequestListener);

        if (restrictedDataToken != null) {
            okhttp3.Request request = call.request();
            request = RestrictedDataTokenSigner.sign(
                    request, restrictedDataToken, "OrdersV0Api-updateVerificationStatus");
            call = apiClient.getHttpClient().newCall(request);
        }

        if (disableRateLimiting || updateVerificationStatusBucket.tryConsume(1)) {
            apiClient.executeAsync(call, callback);
            return call;
        } else throw new ApiException.RateLimitExceeded("updateVerificationStatus operation exceeds rate limit");
    }

    public static class Builder {
        private LWAAuthorizationCredentials lwaAuthorizationCredentials;
        private String endpoint;
        private LWAAccessTokenCache lwaAccessTokenCache;
        private Boolean disableAccessTokenCache = false;
        private Boolean disableRateLimiting = false;

        public Builder lwaAuthorizationCredentials(LWAAuthorizationCredentials lwaAuthorizationCredentials) {
            this.lwaAuthorizationCredentials = lwaAuthorizationCredentials;
            return this;
        }

        public Builder endpoint(String endpoint) {
            this.endpoint = endpoint;
            return this;
        }

        public Builder lwaAccessTokenCache(LWAAccessTokenCache lwaAccessTokenCache) {
            this.lwaAccessTokenCache = lwaAccessTokenCache;
            return this;
        }

        public Builder disableAccessTokenCache() {
            this.disableAccessTokenCache = true;
            return this;
        }

        public Builder disableRateLimiting() {
            this.disableRateLimiting = true;
            return this;
        }

        public OrdersV0Api build() {
            if (lwaAuthorizationCredentials == null) {
                throw new RuntimeException("LWAAuthorizationCredentials not set");
            }

            if (StringUtil.isEmpty(endpoint)) {
                throw new RuntimeException("Endpoint not set");
            }

            LWAAuthorizationSigner lwaAuthorizationSigner = null;
            if (disableAccessTokenCache) {
                lwaAuthorizationSigner = new LWAAuthorizationSigner(lwaAuthorizationCredentials);
            } else {
                if (lwaAccessTokenCache == null) {
                    lwaAccessTokenCache = new LWAAccessTokenCacheImpl();
                }
                lwaAuthorizationSigner = new LWAAuthorizationSigner(lwaAuthorizationCredentials, lwaAccessTokenCache);
            }

            return new OrdersV0Api(
                    new ApiClient()
                            .setLWAAuthorizationSigner(lwaAuthorizationSigner)
                            .setBasePath(endpoint),
                    disableRateLimiting);
        }
    }
}
